iOS
Enable HealthKit and add the Info.plist usage descriptions for the health plugin on iOS.
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.
Enable the HealthKit capability
In your Xcode project, open Targets → Runner → Signing & Capabilities and add HealthKit.
Add usage descriptions to Info.plist
Add both keys, each with the user-facing rationale for your app:
ios/Runner/Info.plist
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_RATEandATRIAL_FIBRILLATION_BURDEN. - When you write data,
recordingMethodmust bemanualorautomatic.
See Permissions for the iOS permission model.
iOS-only write types
| Type | Constraint |
|---|---|
| Audiogram | Can be written on iOS only. |
| Insulin delivery | Can be written on iOS only. Requires a valid reason: basal or bolus. |
See Writing data for examples.