Skip to content
CARP Docs
Ask AISystemLightDark
On this page

You are reading the docs for Health 13.x, an older version. Go to 14.x, the latest version.

iOS

Enable HealthKit and add the Info.plist usage descriptions for the health plugin on iOS.

Copy MarkdownOpen inOpen in GitHubView as MarkdownOpen in Scira AIOpen in ChatGPTOpen in ClaudeOpen in Cursor

On iOS, the plugin uses Apple HealthKit. It requires iOS 15.0 or later.

If your app targets an earlier version, select Runner → General in Xcode and set Minimum Deployments to 15.0 or later. If ios/Podfile sets a platform, set it to 15.0 or later too.

  1. Enable the HealthKit capability

    In your Xcode project, open Targets → Runner → Signing & Capabilities and add HealthKit.

  2. Add usage descriptions to Info.plist

    Add both keys, each with the user-facing rationale for your app:

    ios/Runner/Info.plist
    <!-- ios/Runner/Info.plist -->
    <key>NSHealthShareUsageDescription</key>
    <string>We will sync your data with the Apple Health app to give you better insights</string>
    <key>NSHealthUpdateUsageDescription</key>
    <string>We will sync your data with the Apple Health app to give you better insights</string>

Permissions

On iOS, certain types support READ only, such as ECG events. requestAuthorization() throws an ArgumentError if you request WRITE or READ_WRITE access to one of the six types listed below.

  • Types that cannot be written include ELECTROCARDIOGRAM, the heart-rate event types (high, low and irregular), WALKING_HEART_RATE and ATRIAL_FIBRILLATION_BURDEN.
  • When you write data, recordingMethod must be manual or automatic.

See Permissions for the iOS permission model.

iOS-only write types

TypeConstraint
AudiogramCan be written on iOS only.
Insulin deliveryCan be written on iOS only. Requires a valid reason: basal or bolus.

See Writing data for examples.

Quick links

Page · DocumentationCARP DocumentationPage · DocumentationIntroductionPage · DocumentationQuickstartPage · DocumentationTerminologyPage · DocumentationArchitecture