Installation
React Native ==> Apple Health module
To get started, first install the framework
$ npm install react-native-validic-aggregator-ios --save --registry https://validic.jfrog.io/artifactory/api/npm/mobile-npm-release/
or use yarn
$ yarn add react-native-validic-aggregator-ios --registry https://validic.jfrog.io/artifactory/api/npm/mobile-npm-release/
Linking
Automatic
react-native link react-native-validic-aggregator-ios
For iOS users using Pods, you still need to run pod install
after running the above link command inside your IOS
folder.
Manual
Via CocoaPods
Add the following lines to your build targets in your Podfile
pod 'React', :path => '../node_modules/react-native'
pod 'RNValidicHealthkit', :path => '../node_modules/react-native-validic-aggregator-ios'
pod 'RNValidicSession', :path= => '../node_modules/react-native-validic-session'
Then run pod install
Enable Healthkit
To enable use of HealthKit in the app, within the build settings of your target, select the 'Signing & Capabilities' tab and click '+ Capability'. Choose 'HealthKit' and make sure 'Background Delivery' is checked as well.
If Healthkit is not enabled, an error is reported in the console log on app launch but will not report an error during build.
Permission Usage Descriptions
Usage descriptions have to be declared in project's Info.plist
for permissions of the Camera, Bluetooth and to access and update Healthkit data.
- HEALTH_SHARE_USAGE_DESCRIPTION for NSHealthShareUsageDescription
- HEALTH_UPDATE_USAGE_DESCRIPTION for NSHealthUpdateUsageDescription
Usage
import { ValidicHealthKit } from 'react-native-validic-aggregator-ios';
Updated 3 days ago