Commit cab85e17 authored by Terrillo Walls's avatar Terrillo Walls

Readme update

parent 6e59b7d6
# React Native Apple HealthKit # React Native Apple Healthkit
A React Native bridge module for interacting with [Apple HealthKit] data. A React Native bridge module for interacting with [Apple Healthkit] data.
![Alt text](https://devimages.apple.com.edgekey.net/assets/elements/icons/healthkit/healthkit-64x64.png "Apple HealthKit") ![Alt text](https://devimages.apple.com.edgekey.net/assets/elements/icons/Healthkit/Healthkit-64x64.png "Apple Healthkit")
## Table of Contents ## Table of Contents
* [Getting Started](#getting-started) * [Getting Started](#getting-started)
...@@ -11,7 +11,7 @@ A React Native bridge module for interacting with [Apple HealthKit] data. ...@@ -11,7 +11,7 @@ A React Native bridge module for interacting with [Apple HealthKit] data.
* [Permissions](#permissions) * [Permissions](#permissions)
* [Methods](#methods) * [Methods](#methods)
* [isAvailable](#isavailable) * [isAvailable](#isavailable)
* [initHealthKit](#inithealthkit) * [initHealthkit](#initHealthkit)
* [getBiologicalSex](#getbiologicalsex) * [getBiologicalSex](#getbiologicalsex)
* [getDateOfBirth](#getdateofbirth) * [getDateOfBirth](#getdateofbirth)
* [getStepCount](#getstepcount) * [getStepCount](#getstepcount)
...@@ -40,35 +40,33 @@ A React Native bridge module for interacting with [Apple HealthKit] data. ...@@ -40,35 +40,33 @@ A React Native bridge module for interacting with [Apple HealthKit] data.
* [Examples](#examples) * [Examples](#examples)
## References ## References
- Apple HealthKit Documentation [https://developer.apple.com/healthkit/](https://developer.apple.com/healthkit/) - Apple Healthkit Documentation [https://developer.apple.com/Healthkit/](https://developer.apple.com/Healthkit/)
## Getting started ## Getting started
### Installation ### Installation
Install the [rn-apple-healthkit] package from npm: Install the [rn-apple-Healthkit] package from npm:
`npm install rn-apple-healthkit --save` `npm install rn-apple-Healthkit --save`
##### Xcode ##### Xcode
1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]` 1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]`
2. Go to `node_modules``rn-apple-healthkit` and add `RCTAppleHealthKit.xcodeproj` 2. Go to `node_modules``rn-apple-Healthkit` and add `RCTAppleHealthkit.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRCTAppleHealthKit.a` to your project's `Build Phases``Link Binary With Libraries` 3. In XCode, in the project navigator, select your project. Add `libRCTAppleHealthkit.a` to your project's `Build Phases``Link Binary With Libraries`
4. Click `RCTAppleHealthKit.xcodeproj` in the project navigator and go the `Build Settings` tab. Make sure 'All' is toggled on (instead of 'Basic'). In the `Search Paths` section, look for `Header Search Paths` and make sure it contains both `$(SRCROOT)/../../react-native/React` and `$(SRCROOT)/../../../React` - mark both as `recursive`. 4. Click `RCTAppleHealthkit.xcodeproj` in the project navigator and go the `Build Settings` tab. Make sure 'All' is toggled on (instead of 'Basic'). In the `Search Paths` section, look for `Header Search Paths` and make sure it contains both `$(SRCROOT)/../../react-native/React` and `$(SRCROOT)/../../../React` - mark both as `recursive`.
5. Enable HealthKit in your application's `Capabilities` 5. Enable Healthkit in your application's `Capabilities`
![Alt text](/examples/images/Capabilities_HealthKit.png "Xcode Capabilities Section") ![Alt text](/examples/images/Capabilities_Healthkit.png "Xcode Capabilities Section")
6. Compile and run 6. Compile and run
### Usage ### Usage
Just `require` the `rn-apple-healthkit` module and you're ready to go! Just `import` the `rn-apple-Healthkit` module and you're ready to go!
```javascript ```javascript
var AppleHealthKit = require('rn-apple-healthkit'); import AppleHealthkit from 'rn-apple-Healthkit';
...
let options = { let options = {
permissions: { permissions: {
...@@ -77,42 +75,42 @@ let options = { ...@@ -77,42 +75,42 @@ let options = {
} }
}; };
AppleHealthKit.initHealthKit(options: Object, (err: Object, res: Object) => { AppleHealthkit.initHealthkit(options: Object, (err: Object, results: Object) => {
if(err) { if (err) {
console.log("error initializing healthkit: ", err); console.log("error initializing Healthkit: ", err);
return; return;
} }
// healthkit initialized... // Healthkit initialized...
}); });
``` ```
When the module has been successfully initialized you can read and write HealthKit data When the module has been successfully initialized you can read and write Healthkit data
```javascript ```javascript
var AppleHealthKit = require('rn-apple-healthkit'); import AppleHealthkit from 'rn-apple-Healthkit';
var _ = require('lodash');
AppleHealthKit.initHealthKit(null: Object, (err: string, res: Object) => { AppleHealthkit.initHealthkit(null: Object, (err: string, results: Object) => {
... ...
AppleHealthKit.getLatestWeight(null, (err: Object, weight: Object) => { AppleHealthkit.getLatestWeight(null, (err: Object, weight: Object) => {
if(err){ if(err){
console.log("error getting current weight: ", err); console.log("error getting current weight: ", err);
return; return;
} }
// use weight.value ... // use weight.value
}); });
... ...
let options = { value: 200 }; let options = {
AppleHealthKit.saveWeight(options: Object, (err: Object, res: Object) => { value: 200
};
AppleHealthkit.saveWeight(options: Object, (err: Object, results: Object) => {
if (err) { if (err) {
console.log("error saving weight to healthkit: ", err); console.log("error saving weight to Healthkit: ", err);
return; return;
} }
// weight successfully saved // weight successfully saved
...@@ -124,68 +122,66 @@ AppleHealthKit.initHealthKit(null: Object, (err: string, res: Object) => { ...@@ -124,68 +122,66 @@ AppleHealthKit.initHealthKit(null: Object, (err: string, res: Object) => {
``` ```
## Documentation ## Documentation
Permissions ### Permissions
-----------
The available HealthKit permissions to use with `initHealthKit` The available Healthkit permissions to use with `initHealthkit`
| Permission | HealthKit Identifier Type | Read | Write | | Permission | Healthkit Identifier Type | Read | Write |
|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|------|-------| |------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|------|-------|
| ActiveEnergyBurned | [HKQuantityTypeIdentifierActiveEnergyBurned](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifieractiveenergyburned?language=objc) | ✓ | ✓ | | ActiveEnergyBurned | [HKQuantityTypeIdentifierActiveEnergyBurned](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifieractiveenergyburned?language=objc) | ✓ | ✓ |
| AppleExerciseTime | [HKQuantityTypeIdentifierAppleExerciseTime](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierappleexercisetime?language=objc) | ✓ | | | AppleExerciseTime | [HKQuantityTypeIdentifierAppleExerciseTime](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierappleexercisetime?language=objc) | ✓ | |
| BasalEnergyBurned | [HKQuantityTypeIdentifierBasalEnergyBurned](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierbasalenergyburned?language=objc) | ✓ | ✓ | | BasalEnergyBurned | [HKQuantityTypeIdentifierBasalEnergyBurned](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbasalenergyburned?language=objc) | ✓ | ✓ |
| BiologicalSex | [HKCharacteristicTypeIdentifierBiologicalSex](https://developer.apple.com/reference/healthkit/hkcharacteristictypeidentifierbiologicalsex?language=objc) | ✓ | | | BiologicalSex | [HKCharacteristicTypeIdentifierBiologicalSex](https://developer.apple.com/reference/Healthkit/hkcharacteristictypeidentifierbiologicalsex?language=objc) | ✓ | |
| BloodGlucose | [HKQuantityTypeIdentifierBloodGlucose](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierbloodglucose?language=objc) | ✓ | | | BloodGlucose | [HKQuantityTypeIdentifierBloodGlucose](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbloodglucose?language=objc) | ✓ | |
| BodyMassIndex | [HKQuantityTypeIdentifierBodyMassIndex](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierbodymassindex?language=objc) | ✓ | ✓ | | BodyMassIndex | [HKQuantityTypeIdentifierBodyMassIndex](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbodymassindex?language=objc) | ✓ | ✓ |
| BodyTemperature | [HKQuantityTypeIdentifierBodyTemperature](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierbodytemperature?language=objc) | ✓ | | | BodyTemperature | [HKQuantityTypeIdentifierBodyTemperature](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbodytemperature?language=objc) | ✓ | |
| DateOfBirth | [HKCharacteristicTypeIdentifierDateOfBirth](https://developer.apple.com/reference/healthkit/hkcharacteristictypeidentifierdateofbirth?language=objc) | ✓ | | | DateOfBirth | [HKCharacteristicTypeIdentifierDateOfBirth](https://developer.apple.com/reference/Healthkit/hkcharacteristictypeidentifierdateofbirth?language=objc) | ✓ | |
| DietaryEnergy | [HKQuantityTypeIdentifierDietaryEnergyConsumed](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierdietaryenergyconsumed?language=objc) | ✓ | ✓ | | DietaryEnergy | [HKQuantityTypeIdentifierDietaryEnergyConsumed](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierdietaryenergyconsumed?language=objc) | ✓ | ✓ |
| DistanceCycling | [HKQuantityTypeIdentifierDistanceCycling](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierdistancecycling?language=objc) | ✓ | ✓ | | DistanceCycling | [HKQuantityTypeIdentifierDistanceCycling](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierdistancecycling?language=objc) | ✓ | ✓ |
| DistanceWalkingRunning | [HKQuantityTypeIdentifierDistanceWalkingRunning](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierdistancewalkingrunning?language=objc) | ✓ | ✓ | | DistanceWalkingRunning | [HKQuantityTypeIdentifierDistanceWalkingRunning](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierdistancewalkingrunning?language=objc) | ✓ | ✓ |
| FlightsClimbed | [HKQuantityTypeIdentifierFlightsClimbed](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierflightsclimbed?language=objc) | ✓ | ✓ | | FlightsClimbed | [HKQuantityTypeIdentifierFlightsClimbed](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierflightsclimbed?language=objc) | ✓ | ✓ |
| HeartRate | [HKQuantityTypeIdentifierHeartRate](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierheartrate?language=objc) | ✓ | | | HeartRate | [HKQuantityTypeIdentifierHeartRate](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierheartrate?language=objc) | ✓ | |
| Height | [HKQuantityTypeIdentifierHeight](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierheight?language=objc) | ✓ | ✓ | | Height | [HKQuantityTypeIdentifierHeight](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierheight?language=objc) | ✓ | ✓ |
| LeanBodyMass | [HKQuantityTypeIdentifierLeanBodyMass](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierleanbodymass?language=objc) | ✓ | ✓ | | LeanBodyMass | [HKQuantityTypeIdentifierLeanBodyMass](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierleanbodymass?language=objc) | ✓ | ✓ |
| NikeFuel | [HKQuantityTypeIdentifierNikeFuel](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifiernikefuel?language=objc) | ✓ | | | NikeFuel | [HKQuantityTypeIdentifierNikeFuel](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifiernikefuel?language=objc) | ✓ | |
| RespiratoryRate | [HKQuantityTypeIdentifierRespiratoryRate](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierrespiratoryrate?language=objc) | ✓ | | | RespiratoryRate | [HKQuantityTypeIdentifierRespiratoryRate](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierrespiratoryrate?language=objc) | ✓ | |
| SleepAnalysis | [HKCategoryTypeIdentifierSleepAnalysis](https://developer.apple.com/reference/healthkit/hkcategorytypeidentifiersleepanalysis?language=objc) | ✓ | | | SleepAnalysis | [HKCategoryTypeIdentifierSleepAnalysis](https://developer.apple.com/reference/Healthkit/hkcategorytypeidentifiersleepanalysis?language=objc) | ✓ | |
| StepCount | [HKQuantityTypeIdentifierStepCount](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierstepcount?language=objc) | ✓ | ✓ | | StepCount | [HKQuantityTypeIdentifierStepCount](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierstepcount?language=objc) | ✓ | ✓ |
| Steps | [HKQuantityTypeIdentifierSteps](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifiersteps?language=objc) | ✓ | ✓ | | Steps | [HKQuantityTypeIdentifierSteps](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifiersteps?language=objc) | ✓ | ✓ |
| Weight | [HKQuantityTypeIdentifierBodyMass](https://developer.apple.com/reference/healthkit/hkquantitytypeidentifierbodymass?language=objc) | ✓ | ✓ | | Weight | [HKQuantityTypeIdentifierBodyMass](https://developer.apple.com/reference/Healthkit/hkquantitytypeidentifierbodymass?language=objc) | ✓ | ✓ |
These permissions are exported as constants of the `rn-apple-healthkit` module. These permissions are exported as constants of the `rn-apple-Healthkit` module.
## Methods ## Methods
#### **`isAvailable`** #### **`isAvailable`**
Check if HealthKit is available on the device. Check if Healthkit is available on the device.
```javascript ```javascript
import AppleHealthKit from 'rn-apple-healthkit'; import AppleHealthkit from 'rn-apple-Healthkit';
AppleHealthKit.isAvailable((err: Object, available: boolean) => { AppleHealthkit.isAvailable((err: Object, available: boolean) => {
if(available){ if (available) {
// ... // ...
} }
}); });
``` ```
___ ___
#### **`initHealthKit`** #### **`initHealthkit`**
Initialize HealthKit. This will show the HealthKit permissions prompt for any read/write permissions set in the required `options` object. Initialize Healthkit. This will show the Healthkit permissions prompt for any read/write permissions set in the required `options` object.
Due to Apple's privacy model if an app user has previously denied a specific permission then they can not be prompted again for that same permission. The app user would have to go into the Apple Health app and grant the permission to your react-native app under *sources* tab. Due to Apple's privacy model if an app user has previously denied a specific permission then they can not be prompted again for that same permission. The app user would have to go into the Apple Health app and grant the permission to your react-native app under *sources* tab.
For any data that is read from HealthKit the status/error is the same for both. This privacy restriction results in having no knowledge of whether the permission was denied (make sure it's added to the permissions options object), or the data for the specific request was nil (ex. no steps recorded today). For any data that is read from Healthkit the status/error is the same for both. This privacy restriction results in having no knowledge of whether the permission was denied (make sure it's added to the permissions options object), or the data for the specific request was nil (ex. no steps recorded today).
For any data written to HealthKit an authorization error can be caught. If an authorization error occurs you can prompt the user to set the specific permission or add the permission to the options object if not present. For any data written to Healthkit an authorization error can be caught. If an authorization error occurs you can prompt the user to set the specific permission or add the permission to the options object if not present.
If new read/write permissions are added to the options object then the app user will see the HealthKit permissions prompt with the new permissions to allow. If new read/write permissions are added to the options object then the app user will see the Healthkit permissions prompt with the new permissions to allow.
`initHealthKit` requires an options object with HealthKit permission settings `initHealthkit` requires an options object with Healthkit permission settings
```javascript ```javascript
let options = { let options = {
permissions: { permissions: {
...@@ -196,13 +192,13 @@ let options = { ...@@ -196,13 +192,13 @@ let options = {
``` ```
```javascript ```javascript
AppleHealthKit.initHealthKit(options: Object, (err: string, res: Object) => { AppleHealthkit.initHealthkit(options: Object, (err: string, results: Object) => {
if (err) { if (err) {
console.log("error initializing healthkit: ", err); console.log("error initializing Healthkit: ", err);
return; return;
} }
// healthkit is initialized... // Healthkit is initialized...
// now safe to read and write healthkit data... // now safe to read and write Healthkit data...
}); });
``` ```
...@@ -219,21 +215,35 @@ Get the biological sex (gender). If the `BiologicalSex` read permission is missi ...@@ -219,21 +215,35 @@ Get the biological sex (gender). If the `BiologicalSex` read permission is missi
| other | HKBiologicalSexOther | | other | HKBiologicalSexOther |
```javascript ```javascript
AppleHealthKit.getBiologicalSex(null, (err: Object, res: Object) => { AppleHealthkit.getBiologicalSex(null, (err: Object, results: Object) => {
if(this._handleHealthKitError(err, 'getBiologicalSex')){ if (this._handleHealthkitError(err, 'getBiologicalSex')) {
return; return;
} }
// res.value will be one of the values from the above table (Value column) console.log(results)
// use res.value ...
}); });
``` ```
```javascript
{
value: 'female',
}
```
___ ___
#### **`getDateOfBirth`** #### **`getDateOfBirth`**
Get the date of birth. 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): 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) => {
if (this._handleHealthkitError(err, 'getDateOfBirth')) {
return;
}
console.log(results)
});
```
```javascript ```javascript
{ {
value: '1986-09-01T00:00:00.000-0400', value: '1986-09-01T00:00:00.000-0400',
...@@ -241,16 +251,6 @@ On success, the callback function will be provided with a `res` object containin ...@@ -241,16 +251,6 @@ On success, the callback function will be provided with a `res` object containin
} }
``` ```
```javascript
AppleHealthKit.getDateOfBirth(null, (err: Object, res: Object) => {
if(this._handleHealthKitError(err, 'getDateOfBirth')){
return;
}
// use res.value ... (ex: '1986-09-01T12:20:30-04:00')
// use res.age ... (ex: 29)
});
```
___ ___
#### **`getStepCount`** #### **`getStepCount`**
...@@ -258,21 +258,27 @@ Get the aggregated total steps for a specific day (starting and ending at midnig ...@@ -258,21 +258,27 @@ Get the aggregated total steps for a specific day (starting and ending at midnig
An optional options object may be provided containing `date` field representing the selected day. If `date` is not set or an options object is not provided then the current day will be used. An optional options object may be provided containing `date` field representing the selected day. If `date` is not set or an options object is not provided then the current day will be used.
```javascript ```javascript
let d = new Date(2016,5,27); let d = new Date(2016,1,1);
let options = { let options = {
date: d.toISOString() date: d.toISOString()
}; };
``` ```
```javascript ```javascript
AppleHealthKit.getStepCount(options: Object, (err: Object, steps: Object) => { AppleHealthkit.getStepCount(options: Object, (err: Object, results: Object) => {
if(this._handleHealthKitError(err, 'getStepCount')){ if (this._handleHealthkitError(err, 'getStepCount')) {
return; return;
} }
// steps.value is the step count for day 'd' console.log(results)
}); });
``` ```
```javascript
{
value: 213,
}
```
___ ___
#### **`getDailyStepCountSamples`** #### **`getDailyStepCountSamples`**
...@@ -281,51 +287,43 @@ Get the total steps per day over a specified date range. ...@@ -281,51 +287,43 @@ Get the total steps per day over a specified date range.
`getDailyStepCountSamples` accepts an options object containing required *`startDate: ISO8601Timestamp`* and optional *`endDate: ISO8601Timestamp`*. If `endDate` is not provided it will default to the current time `getDailyStepCountSamples` accepts an options object containing required *`startDate: ISO8601Timestamp`* and optional *`endDate: ISO8601Timestamp`*. If `endDate` is not provided it will default to the current time
```javascript ```javascript
let options = { let options = {
startDate: (new Date(2016,5,1)).toISOString() // required startDate: (new Date(2016,1,1)).toISOString() // required
endDate: (new Date()).toISOString() // optional; default now endDate: (new Date()).toISOString() // optional; default now
}; };
``` ```
```javascript
AppleHealthkit.getDailyStepCountSamples(options: Object, (err: Object, results: Array<Object>) => {
if (this._handleHealthkitError(err, 'getDailyStepCountSamples')) {
return;
}
console.log(results)
});
```
The function will be called with an array of elements. Each element is an object containing `value`, `startDate`, and `endDate` fields: The function will be called with an array of elements. Each element is an object containing `value`, `startDate`, and `endDate` fields:
```javascript ```javascript
[ [
{ value: 8, startDate: '2016-07-09T00:00:00.000-0400', endDate: '2016-07-10T00:00:00.000-0400' }, { value: 8, startDate: '2016-07-09T00:00:00.000-0400', endDate: '2016-07-10T00:00:00.000-0400' },
{ value: 1923, startDate: '2016-07-08T00:00:00.000-0400', endDate: '2016-07-09T00:00:00.000-0400' }, { value: 1923, startDate: '2016-07-08T00:00:00.000-0400', endDate: '2016-07-09T00:00:00.000-0400' },
{ value: 1802, startDate: '2016-07-07T00:00:00.000-0400', endDate: '2016-07-08T00:00:00.000-0400' }, { value: 1802, startDate: '2016-07-07T00:00:00.000-0400', endDate: '2016-07-08T00:00:00.000-0400' },
...
] ]
``` ```
```javascript
AppleHealthKit.getDailyStepCountSamples(options: Object, (err: Object, res: Array<Object>) => {
if(this._handleHealthKitError(err, 'getDailyStepCountSamples')){
return;
}
// 'res' is array of {value: number, startDate: string, endDate: string} objects
// sorted ascending from startDate through endDate
for(let i=0; i<res.length; ++i){
let elem = res[i];
let stepCount = elem.value;
let day = elem.startDate;
// ...
}
});
```
___ ___
#### **`initStepCountObserver`** #### **`initStepCountObserver`**
Setup an HKObserverQuery for step count (HKQuantityTypeIdentifierStepCount) that will Setup an HKObserverQuery for step count (HKQuantityTypeIdentifierStepCount) that will
trigger an event listenable on react-native `NativeAppEventEmitter` when the trigger an event listenable on react-native `NativeAppEventEmitter` when the
HealthKit step count has changed. Healthkit step count has changed.
The `initStepCountObserver` method must be called before adding a listener to The `initStepCountObserver` method must be called before adding a listener to
NativeAppEventEmitter. After the step count observer has been initialized you can NativeAppEventEmitter. After the step count observer has been initialized you can
listen to the NativeAppEventEmitter `change:steps` event and re-fetch relevent listen to the NativeAppEventEmitter `change:steps` event and re-fetch relevent
step count data in the event handler. step count data in the event handler.
The `initStepCountObserver` method should be called after HealthKit has been 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). error).
```javascript ```javascript
...@@ -333,22 +331,19 @@ error). ...@@ -333,22 +331,19 @@ error).
import { import {
Navigator, Navigator,
View, View,
...
NativeAppEventEmitter, NativeAppEventEmitter,
} from 'react-native'; } from 'react-native';
```
...
// initialize the step count observer and add an event ```javascript
// listener for 'change:steps' event after HealthKit has AppleHealthkit.initHealthkit(HKOPTIONS, (err, res) => {
// been successfully initialized. if (this._handleHKError(err, 'initHealthkit')) {
AppleHealthKit.initHealthKit(HKOPTIONS, (err, res) => {
if(this._handleHKError(err, 'initHealthKit')){
return; return;
} }
// initialize the step count observer // initialize the step count observer
AppleHealthKit.initStepCountObserver({}, () => {}); AppleHealthkit.initStepCountObserver({}, () => {});
// add event listener for 'change:steps' and handle the // add event listener for 'change:steps' and handle the
// event in the event handler function. // event in the event handler function.
...@@ -362,15 +357,15 @@ AppleHealthKit.initHealthKit(HKOPTIONS, (err, res) => { ...@@ -362,15 +357,15 @@ AppleHealthKit.initHealthKit(HKOPTIONS, (err, res) => {
'change:steps', 'change:steps',
(evt) => { (evt) => {
// a 'change:steps' event has been received. step // a 'change:steps' event has been received. step
// count data should be re-fetched from HealthKit. // count data should be re-fetched from Healthkit.
this._fetchStepCountData(); this._fetchStepCountData();
} }
); );
// other tasks to perform after HealthKit has been // other tasks to perform after Healthkit has been
// initialized (fetch relevant HealthKit data). // initialized (fetch relevant Healthkit data).
this._fetchStepCountData(); this._fetchStepCountData();
this._fetchOtherRelevantHealthKitData(); this._fetchOtherRelevantHealthkitData();
// ... // ...
}); });
...@@ -394,7 +389,7 @@ A step count sample represents the number of steps during a specific period of t ...@@ -394,7 +389,7 @@ A step count sample represents the number of steps during a specific period of t
`saveSteps` accepts an options object containing required *`value: number`*, *`startDate: ISO8601Timestamp`*, and *`endDate: ISO8601Timestamp`*. `saveSteps` accepts an options object containing required *`value: number`*, *`startDate: ISO8601Timestamp`*, and *`endDate: ISO8601Timestamp`*.
```javascript ```javascript
// startDate and endDate are 30 minutes apart. // startDate and endDate are 30 minutes apart.
// this means the step count value occured within those 30 minutes. // this means the step count value occurred within those 30 minutes.
let options = { let options = {
value: 100, value: 100,
startDate: (new Date(2016,6,2,6,0,0)).toISOString(), startDate: (new Date(2016,6,2,6,0,0)).toISOString(),
...@@ -403,8 +398,8 @@ let options = { ...@@ -403,8 +398,8 @@ let options = {
``` ```
```javascript ```javascript
AppleHealthKit.saveSteps(options, (err, res) => { AppleHealthkit.saveSteps(options, (err, res) => {
if(this._handleHKError(err, 'saveSteps')){ if (this._handleHKError(err, 'saveSteps')) {
return; return;
} }
// step count sample successfully saved // step count sample successfully saved
...@@ -423,17 +418,20 @@ let options = { ...@@ -423,17 +418,20 @@ let options = {
unit: 'mile', // optional; default 'meter' unit: 'mile', // optional; default 'meter'
date: (new Date(2016,5,1)).toISOString(), // optional; default now date: (new Date(2016,5,1)).toISOString(), // optional; default now
}; };
```
AppleHealthKit.getDistanceWalkingRunning(options: Object, (err: Object, res: Object) => { ```javascript
if(this._handleHKError(err, 'getDistanceWalkingRunning')){ AppleHealthkit.getDistanceWalkingRunning(options: Object, (err: Object, results: Object) => {
if (this._handleHKError(err, 'getDistanceWalkingRunning')) {
return; return;
} }
console.log(results)
}); });
``` ```
```javascript ```javascript
{ {
value: 200, value: 1.45,
startDate: '2016-07-08T12:00:00.000-0400', startDate: '2016-07-08T12:00:00.000-0400',
endDate: '2016-07-08T12:00:00.000-0400' endDate: '2016-07-08T12:00:00.000-0400'
} }
...@@ -447,20 +445,28 @@ Get the total distance cycling on a specific day. ...@@ -447,20 +445,28 @@ Get the total distance cycling on a specific day.
`getDistanceCycling` accepts an options object containing optional *`date: ISO8601Timestamp`* and *`unit: string`*. If `date` is not provided it will default to the current time. `unit` defaults to `meter` `getDistanceCycling` accepts an options object containing optional *`date: ISO8601Timestamp`* and *`unit: string`*. If `date` is not provided it will default to the current time. `unit` defaults to `meter`
```javascript ```javascript
let options = { let options = {
unit: 'meter', // optional; default 'meter' unit: 'mile', // optional; default 'meter'
date: (new Date(2016,5,1)).toISOString(), // optional; default now date: (new Date(2016,5,1)).toISOString(), // optional; default now
}; };
``` ```
```javascript ```javascript
AppleHealthKit.getDistanceCycling(options: Object, (err: Object, res: Object) => { AppleHealthkit.getDistanceCycling(options: Object, (err: Object, results: Object) => {
if(this._handleHKError(err, 'getDistanceCycling')){ if (err) {
return; return;
} }
// use res.value ... console.log(results)
}); });
``` ```
```javascript
{
value: 11.45,
startDate: '2016-07-08T12:00:00.000-0400',
endDate: '2016-07-08T12:00:00.000-0400'
}
```
___ ___
#### **`getFlightsClimbed`** #### **`getFlightsClimbed`**
...@@ -474,14 +480,22 @@ let options = { ...@@ -474,14 +480,22 @@ let options = {
``` ```
```javascript ```javascript
AppleHealthKit.getFlightsClimbed(options: Object, (err: Object, res: Object) => { AppleHealthkit.getFlightsClimbed(options: Object, (err: Object, results: Object) => {
if(this._handleHKError(err, 'getFlightsClimbed')){ if (err) {
return; return;
} }
// use res.value ... console.log(results)
}); });
``` ```
```javascript
{
value: 15,
startDate: '2016-07-08T12:00:00.000-0400',
endDate: '2016-07-08T12:00:00.000-0400'
}
```
___ ___
#### **`getLatestWeight`** #### **`getLatestWeight`**
...@@ -490,20 +504,18 @@ Get the most recent weight sample. ...@@ -490,20 +504,18 @@ Get the most recent weight sample.
On success, the callback function will be provided with a `weight` object containing the weight `value`, and the `startDate` and `endDate` of the weight sample. *Note: startDate and endDate will be the same as weight samples are saved at a specific point in time.* On success, the callback function will be provided with a `weight` object containing the weight `value`, and the `startDate` and `endDate` of the weight sample. *Note: startDate and endDate will be the same as weight samples are saved at a specific point in time.*
```javascript ```javascript
AppleHealthKit.initHealthKit(null: Object, (err: string, res: Object) => { let options = {
let options = {
unit: 'pound' unit: 'pound'
}; };
```
AppleHealthKit.getLatestWeight(options, (err: string, weight: Object) => { ```javascript
AppleHealthkit.getLatestWeight(options, (err: string, results: Object) => {
if (err) { if (err) {
console.log("error getting latest weight: ", err); console.log("error getting latest weight: ", err);
return; return;
} }
console.log(weight) console.log(results)
});
}); });
``` ```
...@@ -530,30 +542,41 @@ let options = { ...@@ -530,30 +542,41 @@ let options = {
``` ```
```javascript ```javascript
AppleHealthKit.getWeightSamples(options, (err: Object, samples: Array<Object>) => { AppleHealthkit.getWeightSamples(options, (err: Object, results: Array<Object>) => {
if(this._handleHealthKitError(err, 'getWeightSamples')){ if (err) {
return; return;
} }
// use samples ... console.log(results)
}); });
``` ```
```javascript
[
{ value: 160, startDate: '2016-07-09T00:00:00.000-0400', endDate: '2016-07-10T00:00:00.000-0400' },
{ value: 161, startDate: '2016-07-08T00:00:00.000-0400', endDate: '2016-07-09T00:00:00.000-0400' },
{ value: 165, startDate: '2016-07-07T00:00:00.000-0400', endDate: '2016-07-08T00:00:00.000-0400' },
]
```
___ ___
#### **`saveWeight`** #### **`saveWeight`**
save a numeric weight value to HealthKit save a numeric weight value to Healthkit
`saveWeight` accepts an options object containing a numeric weight value: `saveWeight` accepts an options object containing a numeric weight value:
```javascript ```javascript
let options = {value: 200} let options = {
value: 200
}
``` ```
```javascript ```javascript
AppleHealthKit.saveWeight(options: Object, (err: Object, res: Object) => { AppleHealthkit.saveWeight(options: Object, (err: Object, results: Object) => {
if(err){ if (err) {
console.log("error saving weight to healthkit: ", err); console.log("error saving weight to Healthkit: ", err);
return; return;
} }
// weight successfully saved // Done
}); });
``` ```
...@@ -563,25 +586,25 @@ ___ ...@@ -563,25 +586,25 @@ ___
Get the most recent height value. 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.* 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
{
value: 72,
startDate: '2016-07-08T12:00:00.000-0400',
endDate: '2016-07-08T12:00:00.000-0400'
}
```
```javascript ```javascript
AppleHealthKit.getLatestHeight(null, (err: string, height: Object) => { AppleHealthkit.getLatestHeight(null, (err: string, results: Object) => {
if(err){ if (err) {
console.log("error getting latest height: ", err); console.log("error getting latest height: ", err);
return; return;
} }
// use height.value, height.startDate, etc ... console.log(results)
}); });
``` ```
```javascript
{
value: 72,
startDate: '2016-07-08T12:00:00.000-0400',
endDate: '2016-07-08T12:00:00.000-0400'
}
```
___ ___
#### **`getHeightSamples`** #### **`getHeightSamples`**
...@@ -596,37 +619,38 @@ let options = { ...@@ -596,37 +619,38 @@ let options = {
}; };
``` ```
the callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields
```javascript
// samples is array of objects
[
{value: 74.02, startDate:'2016-06-29T17:55:00.000-0400', endDate:'2016-06-29T17:55:00.000-0400'},
{value: 74, startDate:'2016-03-12T13:22:00.000-0400', endDate:'2016-03-12T13:22:00.000-0400'},
...
]
```
*example usage*
```javascript ```javascript
AppleHealthKit.getHeightSamples(options, (err: Object, samples: Array<Object>) => { AppleHealthkit.getHeightSamples(options, (err: Object, results: Array<Object>) => {
if(this._handleHealthKitError(err, 'getHeightSamples')){ if (err) {
return; return;
} }
// use samples ... console.log(results)
}); });
``` ```
The callback function will be called with a `samples` array containing objects with `value`, `startDate`, and `endDate` fields
```javascript
[
{ value: 74.02, startDate:'2016-06-29T17:55:00.000-0400', endDate:'2016-06-29T17:55:00.000-0400' },
{ value: 74, startDate:'2016-03-12T13:22:00.000-0400', endDate:'2016-03-12T13:22:00.000-0400' },
]
```
___ ___
#### **`saveHeight`** #### **`saveHeight`**
save a numeric height value to HealthKit save a numeric height value to Healthkit
`saveHeight` accepts an options object containing a numeric height value: `saveHeight` accepts an options object containing a numeric height value:
```javascript ```javascript
let options = {value: 200} let options = {
value: 200
}
``` ```
```javascript ```javascript
AppleHealthKit.saveHeight(options: Object, (err: Object, res: Object) => { AppleHealthkit.saveHeight(options: Object, (err: Object, results: Object) => {
if(this._handleHealthKitError(err, 'saveHeight')){ if (err) {
return; return;
} }
// height successfully saved // height successfully saved
...@@ -639,6 +663,16 @@ ___ ...@@ -639,6 +663,16 @@ ___
Get the most recent BMI sample. 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.* 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) => {
if (err) {
console.log("error getting latest bmi data: ", err);
return;
}
console.log(results)
});
```
```javascript ```javascript
{ {
value: 27.2, value: 27.2,
...@@ -647,30 +681,20 @@ On success, the callback function will be provided with a `bmi` object containin ...@@ -647,30 +681,20 @@ On success, the callback function will be provided with a `bmi` object containin
} }
``` ```
```javascript
AppleHealthKit.getLatestBmi(null, (err: string, bmi: Object) => {
if(err){
console.log("error getting latest bmi data: ", err);
return;
}
let d = bmi.startDate
let val = bmi.value;
// ...
});
```
___ ___
#### **`saveBmi`** #### **`saveBmi`**
save a numeric BMI value to HealthKit save a numeric BMI value to Healthkit
`saveBmi` accepts an options object containing a numeric BMI value: `saveBmi` accepts an options object containing a numeric BMI value:
```javascript ```javascript
let options = {value: 27.2} let options = {
value: 27.2
}
``` ```
```javascript ```javascript
AppleHealthKit.saveBmi(options: Object, (err: Object, res: Object) => { AppleHealthkit.saveBmi(options: Object, (err: Object, results: Object) => {
if(this._handleHealthKitError(err, 'saveBmi')){ if (err) {
return; return;
} }
// BMI successfully saved // BMI successfully saved
...@@ -683,6 +707,16 @@ ___ ...@@ -683,6 +707,16 @@ ___
Get the most recent body fat percentage. The percentage value is a number between 0 and 100. Get the most recent body fat percentage. The percentage value is a number between 0 and 100.
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.* 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) => {
if (err) {
return;
}
console.log(results)
});
```
```javascript ```javascript
{ {
value: 20, value: 20,
...@@ -691,21 +725,22 @@ On success, the callback function will be provided with a `bodyFatPercentage` ob ...@@ -691,21 +725,22 @@ On success, the callback function will be provided with a `bodyFatPercentage` ob
} }
``` ```
```javascript
AppleHealthKit.getLatestBodyFatPercentage(null, (err: Object, bodyFatPercentage: Object) => {
if(this._handleHealthKitError(err, 'getLatestBodyFatPercentage')){
return;
}
// use bodyFatPercentage.value, bodyFatPercentage.startDate, etc ...
});
```
___ ___
#### **`getLatestLeanBodyMass`** #### **`getLatestLeanBodyMass`**
Get the most recent lean body mass. The value is a number representing the weight in pounds (lbs) Get the most recent lean body mass. The value is a number representing the weight in pounds (lbs)
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.* 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) => {
if (err) {
return;
}
console.log(results)
});
```
```javascript ```javascript
{ {
value: 176, value: 176,
...@@ -714,15 +749,6 @@ On success, the callback function will be provided with a `leanBodyMass` object ...@@ -714,15 +749,6 @@ On success, the callback function will be provided with a `leanBodyMass` object
} }
``` ```
```javascript
AppleHealthKit.getLatestLeanBodyMass(null, (err: Object, leanBodyMass: Object) => {
if(this._handleHealthKitError(err, 'getLatestLeanBodyMass')){
return;
}
// use leanBodyMass.value, leanBodyMass.startDate, etc ...
});
```
___ ___
#### **`getHeartRateSamples`** #### **`getHeartRateSamples`**
...@@ -738,17 +764,22 @@ let options = { ...@@ -738,17 +764,22 @@ let options = {
``` ```
the callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields the callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields
*example usage*
```javascript ```javascript
AppleHealthKit.getHeartRateSamples(options, (err: Object, samples: Array<Object>) => { AppleHealthkit.getHeartRateSamples(options, (err: Object, results: Array<Object>) => {
if(this._handleHealthKitError(err, 'getHeartRateSamples')){ if (err) {
return; return;
} }
// use samples ... console.log(results)
}); });
``` ```
```javascript
[
{ value: 74.02, startDate:'2016-06-29T17:55:00.000-0400', endDate:'2016-06-29T17:55:00.000-0400' },
{ value: 74, startDate:'2016-03-12T13:22:00.000-0400', endDate:'2016-03-12T13:22:00.000-0400' },
]
```
___ ___
#### **`getBodyTemperatureSamples`** #### **`getBodyTemperatureSamples`**
...@@ -766,16 +797,22 @@ available units are: `'fahrenheit'`, `'celsius'`. ...@@ -766,16 +797,22 @@ available units are: `'fahrenheit'`, `'celsius'`.
the callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields. the callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields.
*example usage*
```javascript ```javascript
AppleHealthKit.getBodyTemperatureSamples(options, (err: Object, samples: Array<Object>) => { AppleHealthkit.getBodyTemperatureSamples(options, (err: Object, results: Array<Object>) => {
if(this._handleHealthKitError(err, 'getBodyTemperatureSamples')){ if (err) {
return; return;
} }
// use samples ... console.log(results)
}); });
``` ```
```javascript
[
{ value: 74.02, startDate:'2016-06-29T17:55:00.000-0400', endDate:'2016-06-29T17:55:00.000-0400' },
{ value: 74, startDate:'2016-03-12T13:22:00.000-0400', endDate:'2016-03-12T13:22:00.000-0400' },
]
```
___ ___
#### **`getBloodPressureSamples`** #### **`getBloodPressureSamples`**
...@@ -791,24 +828,24 @@ let options = { ...@@ -791,24 +828,24 @@ let options = {
``` ```
the callback function will be called with a `samples` array containing objects with *bloodPressureSystolicValue*, *bloodPressureDiastolicValue*, *startDate*, and *endDate* fields the callback function will be called with a `samples` array containing objects with *bloodPressureSystolicValue*, *bloodPressureDiastolicValue*, *startDate*, and *endDate* fields
```javascript ```javascript
// samples is array of objects AppleHealthkit.getBloodPressureSamples(options, (err: Object, results: Array<Object>) => {
[ if (err) {
{bloodPressureSystolicValue: 120, bloodPressureDiastolicValue: 81, startDate:'2016-06-29T17:55:00.000-0400', endDate:'2016-06-29T17:55:00.000-0400'},
{bloodPressureSystolicValue: 119, bloodPressureDiastolicValue: 77, startDate:'2016-03-12T13:22:00.000-0400', endDate:'2016-03-12T13:22:00.000-0400'},
...
]
```
*example usage*
```javascript
AppleHealthKit.getBloodPressureSamples(options, (err: Object, samples: Array<Object>) => {
if(this._handleHealthKitError(err, 'getBloodPressureSamples')){
return; return;
} }
// use samples ... console.log(results)
}); });
``` ```
```javascript
[
{ bloodPressureSystolicValue: 120, bloodPressureDiastolicValue: 81, startDate:'2016-06-29T17:55:00.000-0400', endDate:'2016-06-29T17:55:00.000-0400' },
{ bloodPressureSystolicValue: 119, bloodPressureDiastolicValue: 77, startDate:'2016-03-12T13:22:00.000-0400', endDate:'2016-03-12T13:22:00.000-0400' },
]
```
___ ___
#### **`getRespiratoryRateSamples`** #### **`getRespiratoryRateSamples`**
...@@ -825,13 +862,12 @@ let options = { ...@@ -825,13 +862,12 @@ let options = {
the callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields the callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields
*example usage*
```javascript ```javascript
AppleHealthKit.getRespiratoryRateSamples(options, (err: Object, samples: Array<Object>) => { AppleHealthkit.getRespiratoryRateSamples(options, (err: Object, results: Array<Object>) => {
if(this._handleHealthKitError(err, 'getRespiratoryRateSamples')){ if (err) {
return; return;
} }
// use samples ... console.log(results)
}); });
``` ```
...@@ -852,17 +888,15 @@ available units are: `'mmolPerL'`, `'mgPerdL'`. ...@@ -852,17 +888,15 @@ available units are: `'mmolPerL'`, `'mgPerdL'`.
the callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields the callback function will be called with a `samples` array containing objects with *value*, *startDate*, and *endDate* fields
*example usage*
```javascript ```javascript
AppleHealthKit.getBloodGlucoseSamples(options, (err: Object, samples: Array<Object>) => { AppleHealthkit.getBloodGlucoseSamples(options, (err: Object, results: Array<Object>) => {
if(this._handleHealthKitError(err, 'getBloodGlucoseSamples')){ if (err) {
return; return;
} }
// use samples ... console.log(results)
}); });
``` ```
___ ___
#### **`getSleepSamples`** #### **`getSleepSamples`**
...@@ -871,7 +905,7 @@ query for sleep samples. ...@@ -871,7 +905,7 @@ query for sleep samples.
each sleep sample represents a period of time with a startDate and an endDate. each sleep sample represents a period of time with a startDate and an endDate.
the sample's value will be either `INBED` or `ASLEEP`. these values should overlap, the sample's value will be either `INBED` or `ASLEEP`. these values should overlap,
meaning that two (or more) samples represent a single nights sleep activity. see meaning that two (or more) samples represent a single nights sleep activity. see
[HealthKit SleepAnalysis] reference documentation [Healthkit SleepAnalysis] reference documentation
the options object is used to setup a query to retrieve relevant samples. the options object is used to setup a query to retrieve relevant samples.
the options must contain `startDate` and may also optionally include `endDate` the options must contain `startDate` and may also optionally include `endDate`
...@@ -884,21 +918,20 @@ let options = { ...@@ -884,21 +918,20 @@ let options = {
}; };
``` ```
the callback function will be called with a `samples` array containing objects The callback function will be called with a `samples` array containing objects
with *value*, *startDate*, and *endDate* fields with *value*, *startDate*, and *endDate* fields
*example usage*
```javascript ```javascript
AppleHealthKit.getSleepSamples(options, (err: Object, samples: Array<Object>) => { AppleHealthkit.getSleepSamples(options, (err: Object, results: Array<Object>) => {
if(this._handleHealthKitError(err, 'getSleepSamples')){ if (err) {
return; return;
} }
// use samples ... console.log(results).
}); });
``` ```
## Examples ## Examples
- [Steps Demo](https://github.com/GregWilson/rn-apple-healthkit/tree/master/examples/StepsDemo) - [Steps Demo](https://github.com/GregWilson/rn-apple-Healthkit/tree/master/examples/StepsDemo)
- [Body Measurements Demo](https://github.com/GregWilson/rn-apple-healthkit/tree/master/examples/BodyMeasurements) - [Body Measurements Demo](https://github.com/GregWilson/rn-apple-Healthkit/tree/master/examples/BodyMeasurements)
> *This package is fork from [react-native-apple-healthkit](https://github.com/GregWilson/react-native-apple-healthkit)* > *This package is fork from [react-native-apple-Healthkit](https://github.com/GregWilson/react-native-apple-Healthkit)*
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