Skip to content

Set up HealthKit on iOS

Real HealthKit behavior requires a physical iOS device and an App ID whose signing profile includes HealthKit.

  1. Open Edit > Project Settings > HealthBridge > iOS.
  2. Replace fallback text with product-specific read and update explanations.
  3. Enable only the required read and write types in HealthBridgeSettings.
  4. Confirm the project bundle identifier matches the HealthKit-capable App ID.

The iOS build processor adds HealthKit framework linkage, usage descriptions, entitlements, and required Swift settings to the generated Xcode project.

  1. Enable HealthKit for the Apple App ID.
  2. Refresh development and distribution profiles after enabling it.
  3. Configure the matching team/profile in Unity or the signing pipeline.
  4. Verify the final signed application contains the HealthKit entitlement.

Build processing cannot make an App ID HealthKit-capable or replace an invalid provisioning profile.

Use AutoInitializeAsync in the iOS player. You may call PrewarmAsync before the user-facing authorization step; prewarming does not display the system sheet.

Apple does not reveal every per-type read decision:

  • Initialization can succeed after the sheet closes even if a read type was declined.
  • Denied reads can appear as successful empty results.
  • Write denial can fail without a detailed per-type disclosure.

Provide an empty state and instructions for reviewing Health access in iOS Settings or the Health app.

  1. Build the project for a physical device.
  2. Inspect usage descriptions and signed entitlements.
  3. Install the exact artifact being tested.
  4. Test full grant, denial, empty data, write denial, background, and recovery.

The editor and simulator do not prove real HealthKit behavior.