Commit 1d090cff authored by Terrillo Walls's avatar Terrillo Walls

Readme update

parent 50903e0a
# react-native-apple-healthkit # rn-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")
#### Notice #### Notice
> *This package is undergoing rapid development and should be considered unstable for the time being.* > *This package is fork from [react-native-apple-healthkit](https://github.com/GregWilson/react-native-apple-healthkit)*
> *<strong>Use at your own risk</strong>*
## Table of Contents ## Table of Contents
* [Getting Started](#getting-started) * [Getting Started](#getting-started)
...@@ -49,14 +48,14 @@ A React Native bridge module for interacting with [Apple HealthKit] data. ...@@ -49,14 +48,14 @@ A React Native bridge module for interacting with [Apple HealthKit] data.
### Installation ### Installation
Install the [react-native-apple-healthkit] package from npm: Install the [rn-apple-healthkit] package from npm:
`npm install react-native-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``react-native-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`
...@@ -66,9 +65,9 @@ Install the [react-native-apple-healthkit] package from npm: ...@@ -66,9 +65,9 @@ Install the [react-native-apple-healthkit] package from npm:
### Usage ### Usage
Just `require` the `react-native-apple-healthkit` module and you're ready to go! Just `require` the `rn-apple-healthkit` module and you're ready to go!
```javascript ```javascript
var AppleHealthKit = require('react-native-apple-healthkit'); var AppleHealthKit = require('rn-apple-healthkit');
... ...
...@@ -93,7 +92,7 @@ AppleHealthKit.initHealthKit(options: Object, (err: Object, res: Object) => { ...@@ -93,7 +92,7 @@ AppleHealthKit.initHealthKit(options: Object, (err: Object, res: Object) => {
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('react-native-apple-healthkit'); var AppleHealthKit = require('rn-apple-healthkit');
var _ = require('lodash'); var _ = require('lodash');
... ...
...@@ -156,10 +155,10 @@ The available HealthKit permissions to use with `initHealthKit` ...@@ -156,10 +155,10 @@ The available HealthKit permissions to use with `initHealthKit`
| SleepAnalysis | [HKCategoryTypeIdentifierSleepAnalysis](https://developer.apple.com/reference/healthkit/hkcategorytypeidentifiersleepanalysis?language=objc) | ✓ | | SleepAnalysis | [HKCategoryTypeIdentifierSleepAnalysis](https://developer.apple.com/reference/healthkit/hkcategorytypeidentifiersleepanalysis?language=objc) | ✓ |
These permissions are exported as constants of the `react-native-apple-healthkit` module. These permissions are exported as constants of the `rn-apple-healthkit` module.
```javascript ```javascript
import AppleHealthKit from 'react-native-apple-healthkit'; import AppleHealthKit from 'rn-apple-healthkit';
... ...
...@@ -915,17 +914,17 @@ AppleHealthKit.getSleepSamples(options, (err: Object, samples: Array<Object>) => ...@@ -915,17 +914,17 @@ AppleHealthKit.getSleepSamples(options, (err: Object, samples: Array<Object>) =>
#### StepsDemo #### StepsDemo
[Steps Demo](https://github.com/GregWilson/react-native-apple-healthkit/tree/master/examples/StepsDemo) [Steps Demo](https://github.com/GregWilson/rn-apple-healthkit/tree/master/examples/StepsDemo)
![alt text](https://raw.githubusercontent.com/GregWilson/react-native-apple-healthkit/master/examples/images/steps_demo_screen.png "Steps Demo App Screenshot") ![alt text](https://raw.githubusercontent.com/GregWilson/rn-apple-healthkit/master/examples/images/steps_demo_screen.png "Steps Demo App Screenshot")
#### BodyMeasurements #### BodyMeasurements
[Body Measurements Demo](https://github.com/GregWilson/react-native-apple-healthkit/tree/master/examples/BodyMeasurements) [Body Measurements Demo](https://github.com/GregWilson/rn-apple-healthkit/tree/master/examples/BodyMeasurements)
![alt text](https://raw.githubusercontent.com/GregWilson/react-native-apple-healthkit/master/examples/images/body_measurements_demo_screen.png "Body Measurements Demo App Screenshot") ![alt text](https://raw.githubusercontent.com/GregWilson/rn-apple-healthkit/master/examples/images/body_measurements_demo_screen.png "Body Measurements Demo App Screenshot")
[Apple HealthKit]: https://developer.apple.com/healthkit/ [Apple HealthKit]: https://developer.apple.com/healthkit/
[react-native-apple-healthkit]: https://www.npmjs.com/package/react-native-apple-healthkit [rn-apple-healthkit]: https://www.npmjs.com/package/rn-apple-healthkit
[HealthKit SleepAnalysis]: https://developer.apple.com/reference/healthkit/hkcategoryvaluesleepanalysis?language=objc [HealthKit SleepAnalysis]: https://developer.apple.com/reference/healthkit/hkcategoryvaluesleepanalysis?language=objc
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