Installation

Native iOS ==> Apple Health framework

Apple Health has its own module in the Inform SDK, therefore the following modules are required to use the Apple Health integration:

Setup

Enable HealthKit entitlements

To use HealthKit in your project, you must enable it from the "Signing & Capabilities" tab:

  1. Select your project target and then select the "Signing & Capabilities" tab.
  2. Click "+ Capability", scroll down until you find HealthKit, and double-click it to add HealthKit to the project.
  3. Make sure to check the box next to "Background Delivery" in the newly-added HealthKit section. Your project should look like the screenshot below.

If you are manually editing the raw entitlements file, make sure the following keys and values are included:

<key>com.apple.developer.healthkit</key>
<true/>
<key>com.apple.developer.healthkit.background-delivery</key>
<true/>

Linking the HealthKit framework

In new Xcode projects, the HealthKit framework will be linked automatically when the framework is imported by a project file. To confirm this, navigate to the "Build Settings" tab of the project target and search for "Link Frameworks". Under Apple Clang - Language - Modules you should see Link Frameworks Automatically set to Yes.

Add values to Info.plist

In order to use the HealthKit framework, you must provide values in your app's Info.plist file for the Privacy - Health Share Usage Description and Privacy - Health Update Usage Description keys.

If editing the plist file source, add the NSHealthShareUsageDescription and NSHealthUpdateUsageDescription keys as displayed below.

<key>NSHealthShareUsageDescription</key>
<string>Get Health data</string>
<key>NSHealthUpdateUsageDescription</key>
<string>Write Health data</string>