.entitlements plist file and must be configured correctly for features like push notifications, HealthKit, Apple Pay, and more.
What are entitlements?
Entitlements are capabilities that require Apple’s approval and proper configuration. They enable features like:- Associated Domains (Universal Links, Handoff)
- Push Notifications
- App Groups (data sharing between apps)
- iCloud
- HealthKit
- Apple Pay
- Sign in with Apple
- HomeKit
- And many more
The entitlements file
Entitlements are stored inios/<ProjectName>/<ProductName>.entitlements:
Modifying entitlements with plugins
UsewithEntitlementsPlist to modify the entitlements file:
Common entitlements
Associated Domains
For Universal Links, Handoff, and App Clips.Entitlements.ts
applinks:example.com- Universal Linkswebcredentials:example.com- Password AutoFillactivitycontinuation:example.com- Handoffappclips:example.com- App Clips
Push Notifications
Built into Expo by default, but here’s how to add it manually:development- For development buildsproduction- For App Store and TestFlight builds
App Groups
Share data between your app and extensions (widgets, share extensions, etc.).- Start with
group. - Follow reverse-DNS naming (e.g.,
group.com.company.app) - Be registered in Apple Developer Portal
iCloud
Enable iCloud storage and CloudKit.HealthKit
Access health and fitness data.Apple Pay
Accept payments with Apple Pay.Sign in with Apple
Authenticate users with Apple ID.HomeKit
Control smart home devices.Keychain Sharing
Share keychain items between apps.Near Field Communication (NFC)
Read NFC tags.Background Modes
While not technically an entitlement, background modes are configured similarly:Ensuring entitlements file exists
The entitlements file must be properly configured in Xcode. From the source:Entitlements.ts
Reading entitlements
To read the current entitlements file:Entitlements.ts
Helper: createEntitlementsPlugin
Simplify entitlements plugin creation:Combining multiple entitlements
Create a comprehensive plugin:Testing entitlements
Test that entitlements are correctly added:Apple Developer Portal requirements
Many entitlements require configuration in the Apple Developer Portal:- App ID Capabilities: Enable capabilities for your App ID
- Provisioning Profiles: Create profiles that include the capabilities
- Identifiers: Register App Groups, Merchant IDs, etc.
Best practices
1. Only add needed entitlements
Each entitlement increases app review complexity. Only add what you actually use.2. Use variables for dynamic values
3. Validate entitlements
4. Document required Apple Developer setup
Include README instructions for developers about required Apple Developer Portal configuration.Next steps
- Android Permissions - Android equivalent
- Modifying native projects - More iOS modifications
- Plugin API reference - Complete API docs