Commit 950fe096 authored by Terrillo Walls's avatar Terrillo Walls

More docs updates..

parent cc7cb345
# React Native Apple Healthkit
A React Native bridge module for interacting with Apple Healthkit data. Checkout the [full documentation](https://github.com/terrillo/rn-apple-healthkit/wiki)
A React Native bridge module for interacting with Apple Healthkit data. Checkout the [full documentation](https://github.com/terrillo/rn-apple-healthkit/tree/master/docs)
## Installation
......@@ -80,6 +80,11 @@ AppleHealthKit.initHealthKit(options: Object, (err: string, results: Object) =>
0.6.4v
- Basal energy ([#23](https://github.com/terrillo/rn-apple-healthkit/pull/23))
- Fixed issues with saving weight in the past
- Commited the docs to increase pull request support
- Add daily samples for:
- Flights Climbed
- WalkingRunning Distance
- Cycling Distance
0.6.3v
- Food and Water ([#19](https://github.com/terrillo/rn-apple-healthkit/pull/19))
......@@ -105,8 +110,8 @@ AppleHealthKit.initHealthKit(options: Object, (err: string, results: Object) =>
* [getBloodPressureSamples](/docs/getbloodpressuresamples().md)
* [getBodyTemperatureSamples](/docs/getbodytemperaturesamples().md)
* [getDailyDistanceCyclingSamples]()
* [getDailyDistanceWalkingRunningSamples]()
* [getDailyFlightsClimbedSamples]()
* [getDailyDistanceWalkingRunningSamples](/docs/getDailyDistanceWalkingRunningSamples().md)
* [getDailyFlightsClimbedSamples](/docs/getDailyFlightsClimbedSamples().md)
* [getDailyStepCountSamples](/docs/getDailyStepCountSamples().md)
* [getDateOfBirth](/docs/getDateOfBirth().md)
* [getDistanceCycling](/docs/getdistancecycling().md)
......
# React Native Apple Healthkit
A React Native bridge module for interacting with [Apple Healthkit](https://developer.apple.com/Healthkit/) data.
* Base Methods
* [isAvailable](https://github.com/terrillo/rn-apple-healthkit/wiki/isAvailable())
* [initHealthKit](https://github.com/terrillo/rn-apple-healthkit/wiki/initHealthKit())
* Realtime Methods
* [initStepCountObserver](https://github.com/terrillo/rn-apple-healthkit/wiki/initStepCountObserver())
* Read Methods
* [getBiologicalSex](https://github.com/terrillo/rn-apple-healthkit/wiki/getBiologicalSex())
* [getBloodGlucoseSamples](https://github.com/terrillo/rn-apple-healthkit/wiki/getbloodglucosesamples())
* [getBloodPressureSamples](https://github.com/terrillo/rn-apple-healthkit/wiki/getbloodpressuresamples())
* [getBodyTemperatureSamples](https://github.com/terrillo/rn-apple-healthkit/wiki/getbodytemperaturesamples())
* [getDailyStepCountSamples](https://github.com/terrillo/rn-apple-healthkit/wiki/getDailyStepCountSamples())
* [getDateOfBirth](https://github.com/terrillo/rn-apple-healthkit/wiki/getDateOfBirth())
* [getDistanceCycling](https://github.com/terrillo/rn-apple-healthkit/wiki/getdistancecycling())
* [getDistanceWalkingRunning](https://github.com/terrillo/rn-apple-healthkit/wiki/getDistanceWalkingRunning())
* [getFlightsClimbed](https://github.com/terrillo/rn-apple-healthkit/wiki/getflightsclimbed())
* [getHeartRateSamples](https://github.com/terrillo/rn-apple-healthkit/wiki/getheartratesamples())
* [getHeightSamples](https://github.com/terrillo/rn-apple-healthkit/wiki/getheightsamples())
* [getLatestBmi](https://github.com/terrillo/rn-apple-healthkit/wiki/getlatestbmi())
* [getLatestBodyFatPercentage](https://github.com/terrillo/rn-apple-healthkit/wiki/getlatestbodyfatpercentage())
* [getLatestHeight](https://github.com/terrillo/rn-apple-healthkit/wiki/getlatestheight())
* [getLatestLeanBodyMass](https://github.com/terrillo/rn-apple-healthkit/wiki/getlatestleanbodymass())
* [getLatestWeight](https://github.com/terrillo/rn-apple-healthkit/wiki/getlatestweight())
* [getRespiratoryRateSamples](https://github.com/terrillo/rn-apple-healthkit/wiki/getrespiratoryratesamples())
* [getSleepSamples](https://github.com/terrillo/rn-apple-healthkit/wiki/getsleepsamples())
* [getStepCount](https://github.com/terrillo/rn-apple-healthkit/wiki/getStepCount())
* [getWeightSamples](https://github.com/terrillo/rn-apple-healthkit/wiki/getweightsamples())
* Write Methods
* [saveBmi](https://github.com/terrillo/rn-apple-healthkit/wiki/savebmi())
* [saveHeight](https://github.com/terrillo/rn-apple-healthkit/wiki/saveheight())
* [saveMindfulSession](https://github.com/terrillo/rn-apple-healthkit/wiki/saveMindfulSession())
* [saveWeight](https://github.com/terrillo/rn-apple-healthkit/wiki/saveweight())
* [saveSteps](https://github.com/terrillo/rn-apple-healthkit/wiki/saveSteps())
a
\ No newline at end of file
......@@ -9,7 +9,7 @@ let options = {
```
```javascript
AppleHealthkit.getActiveEnergyBurned(options: Object, (err: Object, results: Object) => {
AppleHealthKit.getActiveEnergyBurned(options: Object, (err: Object, results: Object) => {
if (err) {
return;
}
......
......@@ -7,7 +7,7 @@ let options = {
```
```javascript
AppleHealthkit.getBasalEnergyBurned(options: Object, (err: Object, results: Object) => {
AppleHealthKit.getBasalEnergyBurned(options: Object, (err: Object, results: Object) => {
if (err) {
return;
}
......
......@@ -8,7 +8,7 @@ Get the biological sex (gender). If the `BiologicalSex` read permission is missi
| other | HKBiologicalSexOther |
```javascript
AppleHealthkit.getBiologicalSex(null, (err: Object, results: Object) => {
AppleHealthKit.getBiologicalSex(null, (err: Object, results: Object) => {
if (this._handleHealthkitError(err, 'getBiologicalSex')) {
return;
}
......
......@@ -13,7 +13,7 @@ Available units are: `'mmolPerL'`, `'mgPerdL'`.
The callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields
```javascript
AppleHealthkit.getBloodGlucoseSamples(options, (err: Object, results: Array<Object>) => {
AppleHealthKit.getBloodGlucoseSamples(options, (err: Object, results: Array<Object>) => {
if (err) {
return;
}
......
......@@ -12,7 +12,7 @@ let options = {
The callback function will be called with a `samples` array containing objects with *bloodPressureSystolicValue*, *bloodPressureDiastolicValue*, *startDate*, and *endDate* fields
```javascript
AppleHealthkit.getBloodPressureSamples(options, (err: Object, results: Array<Object>) => {
AppleHealthKit.getBloodPressureSamples(options, (err: Object, results: Array<Object>) => {
if (err) {
return;
}
......
......@@ -14,7 +14,7 @@ Available units are: `'fahrenheit'`, `'celsius'`.
The callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields.
```javascript
AppleHealthkit.getBodyTemperatureSamples(options, (err: Object, results: Array<Object>) => {
AppleHealthKit.getBodyTemperatureSamples(options, (err: Object, results: Array<Object>) => {
if (err) {
return;
}
......
```javascript
let options = {
startDate: (new Date(2016,4,27)).toISOString(), // required
endDate: (new Date()).toISOString(), // optional; default now
ascending: false, // optional; default false
limit:10, // optional; default no limit
};
```
```javascript
AppleHealthKit.getDailyDistanceCyclingSamples(options, (err: Object, results: Array<Object>) => {
if (err) {
return;
}
console.log(results)
});
```
```javascript
let options = {
startDate: (new Date(2016,4,27)).toISOString(), // required
endDate: (new Date()).toISOString(), // optional; default now
ascending: false, // optional; default false
limit:10, // optional; default no limit
};
```
```javascript
AppleHealthKit.getDailyDistanceWalkingRunningSamples(options, (err: Object, results: Array<Object>) => {
if (err) {
return;
}
console.log(results)
});
```
```javascript
let options = {
startDate: (new Date(2016,4,27)).toISOString(), // required
endDate: (new Date()).toISOString(), // optional; default now
ascending: false, // optional; default false
limit:10, // optional; default no limit
};
```
```javascript
AppleHealthKit.getDailyFlightsClimbedSamples(options, (err: Object, results: Array<Object>) => {
if (err) {
return;
}
console.log(results)
});
```
......@@ -9,7 +9,7 @@ let options = {
```
```javascript
AppleHealthkit.getDailyStepCountSamples(options: Object, (err: Object, results: Array<Object>) => {
AppleHealthKit.getDailyStepCountSamples(options: Object, (err: Object, results: Array<Object>) => {
if (this._handleHealthkitError(err, 'getDailyStepCountSamples')) {
return;
}
......
......@@ -2,7 +2,7 @@ Get the date of birth.
On success, the callback function will be provided with a `res` object containing dob `value: string` (ISO timestamp), and `age: number` (age in years):
```javascript
AppleHealthkit.getDateOfBirth(null, (err: Object, results: Object) => {
AppleHealthKit.getDateOfBirth(null, (err: Object, results: Object) => {
if (this._handleHealthkitError(err, 'getDateOfBirth')) {
return;
}
......
......@@ -9,7 +9,7 @@ let options = {
```
```javascript
AppleHealthkit.getDistanceCycling(options: Object, (err: Object, results: Object) => {
AppleHealthKit.getDistanceCycling(options: Object, (err: Object, results: Object) => {
if (err) {
return;
}
......
......@@ -10,7 +10,7 @@ let options = {
```
```javascript
AppleHealthkit.getDistanceWalkingRunning(options: Object, (err: Object, results: Object) => {
AppleHealthKit.getDistanceWalkingRunning(options: Object, (err: Object, results: Object) => {
if (err) {
return;
}
......
......@@ -8,7 +8,7 @@ let options = {
```
```javascript
AppleHealthkit.getFlightsClimbed(options: Object, (err: Object, results: Object) => {
AppleHealthKit.getFlightsClimbed(options: Object, (err: Object, results: Object) => {
if (err) {
return;
}
......
......@@ -11,7 +11,7 @@ let options = {
The callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields
```javascript
AppleHealthkit.getHeartRateSamples(options, (err: Object, results: Array<Object>) => {
AppleHealthKit.getHeartRateSamples(options, (err: Object, results: Array<Object>) => {
if (err) {
return;
}
......
......@@ -10,7 +10,7 @@ let options = {
```
```javascript
AppleHealthkit.getHeightSamples(options, (err: Object, results: Array<Object>) => {
AppleHealthKit.getHeightSamples(options, (err: Object, results: Array<Object>) => {
if (err) {
return;
}
......
......@@ -2,7 +2,7 @@ Get the most recent BMI sample.
On success, the callback function will be provided with a `bmi` object containing the BMI `value`, and the `startDate` and `endDate` of the sample. *Note: startDate and endDate will be the same as bmi samples are saved at a specific point in time.*
```javascript
AppleHealthkit.getLatestBmi(null, (err: string, results: Object) => {
AppleHealthKit.getLatestBmi(null, (err: string, results: Object) => {
if (err) {
console.log("error getting latest bmi data: ", err);
return;
......
......@@ -3,7 +3,7 @@ Get the most recent body fat percentage. The percentage value is a number betwee
On success, the callback function will be provided with a `bodyFatPercentage` object containing the body fat percentage `value`, and the `startDate` and `endDate` of the sample. *Note: startDate and endDate will be the same as bodyFatPercentage samples are saved at a specific point in time.*
```javascript
AppleHealthkit.getLatestBodyFatPercentage(null, (err: Object, results: Object) => {
AppleHealthKit.getLatestBodyFatPercentage(null, (err: Object, results: Object) => {
if (err) {
return;
}
......
......@@ -3,7 +3,7 @@ Get the most recent height value.
On success, the callback function will be provided with a `height` object containing the height `value`, and the `startDate` and `endDate` of the height sample. *Note: startDate and endDate will be the same as height samples are saved at a specific point in time.*
```javascript
AppleHealthkit.getLatestHeight(null, (err: string, results: Object) => {
AppleHealthKit.getLatestHeight(null, (err: string, results: Object) => {
if (err) {
console.log("error getting latest height: ", err);
return;
......
......@@ -3,7 +3,7 @@ Get the most recent lean body mass. The value is a number representing the weigh
On success, the callback function will be provided with a `leanBodyMass` object containing the leanBodyMass `value`, and the `startDate` and `endDate` of the sample. *Note: startDate and endDate will be the same as leanBodyMass samples are saved at a specific point in time.*
```javascript
AppleHealthkit.getLatestLeanBodyMass(null, (err: Object, results: Object) => {
AppleHealthKit.getLatestLeanBodyMass(null, (err: Object, results: Object) => {
if (err) {
return;
}
......
......@@ -9,7 +9,7 @@ let options = {
```
```javascript
AppleHealthkit.getLatestWeight(options, (err: string, results: Object) => {
AppleHealthKit.getLatestWeight(options, (err: string, results: Object) => {
if (err) {
console.log("error getting latest weight: ", err);
return;
......
......@@ -13,7 +13,7 @@ let options = {
The callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields
```javascript
AppleHealthkit.getRespiratoryRateSamples(options, (err: Object, results: Array<Object>) => {
AppleHealthKit.getRespiratoryRateSamples(options, (err: Object, results: Array<Object>) => {
if (err) {
return;
}
......
......@@ -20,7 +20,7 @@ The callback function will be called with a `samples` array containing objects
with *value*, *startDate*, and *endDate* fields
```javascript
AppleHealthkit.getSleepSamples(options, (err: Object, results: Array<Object>) => {
AppleHealthKit.getSleepSamples(options, (err: Object, results: Array<Object>) => {
if (err) {
return;
}
......
......@@ -9,7 +9,7 @@ let options = {
```
```javascript
AppleHealthkit.getStepCount(options: Object, (err: Object, results: Object) => {
AppleHealthKit.getStepCount(options: Object, (err: Object, results: Object) => {
if (err) {
return;
}
......
......@@ -11,7 +11,7 @@ let options = {
```
```javascript
AppleHealthkit.getWeightSamples(options, (err: Object, results: Array<Object>) => {
AppleHealthKit.getWeightSamples(options, (err: Object, results: Array<Object>) => {
if (err) {
return;
}
......
......@@ -8,7 +8,7 @@ listen to the NativeAppEventEmitter `change:steps` event and re-fetch relevent
step count data in the event handler.
The `initStepCountObserver` method should be called after Healthkit has been
successfully initialized (AppleHealthkit.initHealthKit has been called without
successfully initialized (AppleHealthKit.initHealthKit has been called without
error).
```javascript
......
Check for Healthkit availability
```javascript
import AppleHealthkit from 'rn-apple-healthkit';
import AppleHealthKit from 'rn-apple-healthkit';
AppleHealthKit.isAvailable((err: Object, available: boolean) => {
if (err) {
......
......@@ -7,7 +7,7 @@ let options = {
}
```
```javascript
AppleHealthkit.saveBmi(options: Object, (err: Object, results: Object) => {
AppleHealthKit.saveBmi(options: Object, (err: Object, results: Object) => {
if (err) {
return;
}
......
......@@ -8,7 +8,7 @@ let options = {
```
```javascript
AppleHealthkit.saveHeight(options: Object, (err: Object, results: Object) => {
AppleHealthKit.saveHeight(options: Object, (err: Object, results: Object) => {
if (err) {
return;
}
......
......@@ -14,7 +14,7 @@ let options = {
```
```javascript
AppleHealthkit.saveSteps(options, (err, res) => {
AppleHealthKit.saveSteps(options, (err, res) => {
if (this._handleHKError(err, 'saveSteps')) {
return;
}
......
......@@ -8,7 +8,7 @@ let options = {
```
```javascript
AppleHealthkit.saveWeight(options: Object, (err: Object, results: Object) => {
AppleHealthKit.saveWeight(options: Object, (err: Object, results: Object) => {
if (err) {
console.log("error saving weight to Healthkit: ", err);
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment