Add usage descriptions to your Info.plist file. These messages will be shown to users when requesting HealthKit permissions.
ios/YourApp/Info.plist
<key>NSHealthShareUsageDescription</key><string>We need access to your health data to track your fitness progress</string><key>NSHealthUpdateUsageDescription</key><string>We need permission to save health data from your workouts</string>
Replace the description text with messages appropriate for your app.
4
Enable HealthKit capability
Open your project in Xcode:
open ios/YourApp.xcworkspace
Select your project in the Project Navigator
Select your app target
Go to Signing & Capabilities
Click + Capability
Add HealthKit
Without the HealthKit capability enabled, your app will crash when trying to use HealthKit APIs.
5
Add Swift bridging header (if needed)
Since this package uses Swift, you might need to add a bridging header if you haven’t already.If your project doesn’t have Swift files yet:
In Xcode, go to File → New → File
Choose Swift File
Name it anything (e.g., Dummy.swift)
When prompted to create a bridging header, click Create Bridging Header