- Install the react-native-health package from npm
yarn add react-native-health
- If you are using CocoaPods you can run the following
from the
ios/folder of your app
pod install
Or, if you need to manually link it, run
react-native link react-native-health
- Update the
info.plistfile in your project
<key>NSHealthShareUsageDescription</key>
<string>Read and understand health data.</string>
<key>NSHealthUpdateUsageDescription</key>
<string>Share workout data with other apps.</string>
- Run
yarn add react-native-health - In XCode, in the project navigator, right-click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-healthand addRCTAppleHealthkit.xcodeproj - In XCode, in the project navigator, select your project. Add
libRCTAppleHealthkit.ato your project'sBuild Phases➜Link Binary With Libraries - Click
RCTAppleHealthkit.xcodeprojin the project navigator and go theBuild Settingstab. Make sure 'All' is toggled on (instead of 'Basic'). In theSearch Pathssection, look forHeader Search Pathsand make sure it contains both$(SRCROOT)/../../react-native/Reactand$(SRCROOT)/../../../React- mark both asrecursive. - Enable Healthkit in your application's
Capabilities - Compile and run
