Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HealthKit entitlements setup instructions to README #412

Open
HongDuHyeon opened this issue Mar 19, 2025 · 0 comments
Open

Add HealthKit entitlements setup instructions to README #412

HongDuHyeon opened this issue Mar 19, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@HongDuHyeon
Copy link

Is your feature request related to a problem? Please describe.
While implementing the react-native-health library, I encountered an error related to missing HealthKit entitlements that wasn't documented in the README. The error was:

"Error with HealthKit authorization: Error Domain=com.apple.healthkit Code=4 "Missing com.apple.developer.healthkit entitlement." UserInfo={NSLocalizedDescription=Missing com.apple.developer.healthkit entitlement.}"

The current documentation mentions adding the necessary NSHealthShareUsageDescription keys to Info.plist, but doesn't describe the required HealthKit entitlements setup.

Describe the solution you'd like
I'd like the README to include a section about setting up HealthKit entitlements with these steps:

  1. In Xcode, select your project in the Project Navigator
  2. Select your app target under "Targets"
  3. Go to the "Signing & Capabilities" tab
  4. Click the "+ Capability" button
  5. Search for and add "HealthKit"

Additionally, include information about manually creating an entitlements file if it's not automatically generated:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.developer.healthkit</key>
    <true/>
    <key>com.apple.developer.healthkit.access</key>
    <array/>
</dict>
</plist>

Describe alternatives you've considered
As an alternative, I considered adding a troubleshooting section that specifically mentions this error and its solution, rather than including it in the main setup instructions.

Additional context
This issue isn't specific to this library but is a requirement for any HealthKit integration. However, including this information would help developers avoid common setup issues, especially those new to HealthKit integration.

@HongDuHyeon HongDuHyeon added the enhancement New feature or request label Mar 19, 2025
@HongDuHyeon HongDuHyeon changed the title Documentation: Add HealthKit entitlements setup instructions to README Add HealthKit entitlements setup instructions to README Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant