Skip to main content
Use the Expo config plugin to configure the Spike SDK for React Native apps.

Expo Installation

This package cannot be used in the “Expo Go” app because it requires custom native code.
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 or npx expo install.
After installing this npm package, add the config plugin to the plugins array of your app.json or app.config.js:
Next, rebuild your app as described in the “Adding custom native code” guide.

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 (and prebuild) the native app. If no extra properties are added, defaults will be used.

iOS Configuration

  • healthSharePermission (string): Sets the iOS NSHealthShareUsageDescription permission message to the Info.plist. Defaults to Allow $(PRODUCT_NAME) to check health info.
  • healthUpdatePermission (string): Sets the iOS NSHealthUpdateUsageDescription permission message to the Info.plist. Defaults to Allow $(PRODUCT_NAME) to update health info.
  • isBackgroundDeliveryEnabled (boolean): Adds com.apple.developer.healthkit.background-delivery entitlement to the iOS project. Defaults to true.

Android Configuration

  • isBackgroundDeliveryEnabled (boolean): Whether to enable background health data deliveries. Defaults to true.
  • healthConnectPermissions (string[]): Array of Health Connect Android permissions to add to the manifest. Defaults to [].
Extensive list of available permissions:

Capabilities

This plugin will enable the iOS com.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.