Expo Installation
The plugin automatically configures both iOS and Android platforms for the Spike SDK. You can find more information about what is being setup in React Native setup guide. First install the package with yarn, npm ornpx expo install.
plugins array of your app.json or app.config.js:
API
The plugin provides configuration options for both iOS and Android platforms. Every time you change the configuration or plugins, you’ll need to rebuild (andprebuild) the native app. If no extra properties are added, defaults will be used.
iOS Configuration
healthSharePermission(string): Sets the iOSNSHealthShareUsageDescriptionpermission message to theInfo.plist. Defaults toAllow $(PRODUCT_NAME) to check health info.healthUpdatePermission(string): Sets the iOSNSHealthUpdateUsageDescriptionpermission message to theInfo.plist. Defaults toAllow $(PRODUCT_NAME) to update health info.isBackgroundDeliveryEnabled(boolean): Addscom.apple.developer.healthkit.background-deliveryentitlement to the iOS project. Defaults totrue.
Android Configuration
isBackgroundDeliveryEnabled(boolean): Whether to enable background health data deliveries. Defaults totrue.healthConnectPermissions(string[]): Array of Health Connect Android permissions to add to the manifest. Defaults to[].
Capabilities
This plugin will enable the iOScom.apple.developer.healthkit entitlement, but to sync this with the bundle identifier’s production capabilities you’ll need to do one of two things:
- Automatic: Build the app with EAS build
- Manual: Visit Apple developer portal and enable the HealthKit capability for your bundle identifier before building for production. This can also be done via Xcode.
