Common Issues
HealthKit permissions not showing
HealthKit permissions not showing
Symptoms: The health permissions dialog doesn’t appear when calling
requestAuthorization().Solutions:-
Verify Info.plist configuration:
-
Check HealthKit capability in Xcode:
- Open your
.xcodeprojor.xcworkspace - Select target → Signing & Capabilities
- Ensure HealthKit is listed
- Open your
- Run on physical device: HealthKit doesn’t work in the iOS Simulator. Always test on a real device.
- Check provisioning profile: Your Apple Developer account must have HealthKit capability enabled for the App ID.
Background sync not working
Background sync not working
Symptoms: Data only syncs when the app is in the foreground.Solutions:
-
Verify background modes in Info.plist:
-
Add AppDelegate handler:
Make sure you’ve added the background URL session handler:
-
Check Background App Refresh setting:
- Go to iOS Settings → Your App → Background App Refresh
- Ensure it’s enabled
- Check Low Power Mode: Background tasks are suspended when Low Power Mode is active.
- Wait for system scheduling: iOS controls when background tasks run. Initial syncs may take 15+ minutes to trigger.
Sign-in fails or token errors
Sign-in fails or token errors
Symptoms: Auth errors or failed sync after sign-in.Solutions:
- Check token expiration: Access tokens expire. Ensure your backend generates fresh tokens.
- Verify API Key: Double-check your API Key on the backend is correct and active.
- Check network connectivity: Ensure the device can reach your Open Wearables host.
-
Enable token refresh:
Provide a
refreshTokenduring sign-in to enable automatic token refresh: -
Listen for auth errors:
Data not appearing in Open Wearables
Data not appearing in Open Wearables
Symptoms: Sync seems to complete but data doesn’t show up in the API.Solutions:
-
Check logs for errors:
- Verify health data exists: Open Apple Health and confirm data exists for the requested types.
- Check date range: The SDK syncs data incrementally. New data may not exist yet.
-
Reset anchors for full sync:
- Check permissions: Users may have denied specific data types even if they approved the overall request.
- Check the outbox: Failed uploads are queued in the persistent outbox. Enable logging to see retry attempts.
Sync doesn't resume after app restart
Sync doesn't resume after app restart
Symptoms: Sync session lost after app is killed or device restarts.Solutions:
-
Ensure configure() is called on launch:
The SDK automatically restores sync state when
configure()is called:The SDK checks for tracked types and active sync state during configuration and auto-resumes if needed. -
Check Keychain access:
Credentials use
kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly. The device must be unlocked at least once after boot for the SDK to access stored credentials. - Verify user hasn’t changed: The SDK isolates state per user. If a different user signs in, previous sync state is cleared.
High memory usage during sync
High memory usage during sync
Symptoms: App uses excessive memory during large syncs.Solutions:The SDK uses streaming sync by default, processing data in chunks to minimize memory usage. If you’re still seeing high memory:
- Check data volume: Initial full syncs can process large amounts of historical data. This is normal and memory should stabilize after the first sync.
- Check for memory leaks in your code: Ensure you’re not holding strong references to SDK callbacks that prevent deallocation.
HealthKit Entitlement Issues
If you see “Missing HealthKit entitlement” errors:-
In Xcode:
- Target → Signing & Capabilities → Add HealthKit
- Check “Background Delivery” for background updates
-
In Apple Developer Portal:
- App IDs → Your App → Capabilities
- Enable HealthKit
- Regenerate provisioning profiles after making changes
Background Delivery Limitations
iOS has strict limits on background execution:| Factor | Impact |
|---|---|
| Battery Level | Background tasks paused below 20% |
| Low Power Mode | All background tasks suspended |
| User Behavior | iOS learns when you use the app and schedules accordingly |
| Network | Background tasks require network connectivity |
| Device Locked | SDK monitors protected data availability and resumes after unlock |
Testing Background Sync
To test background sync during development:- Run app on device
- Navigate to home screen
- Wait 15+ minutes (or use Xcode’s debug menu)
- Check logs for sync activity
- Debug → Simulate Background Fetch
Debugging Tips
Enable Debug Logging
Check Stored Session
Force Fresh Start
If things are in a bad state:Network Monitoring
The SDK includes built-in network monitoring viaNWPathMonitor. When the device loses connectivity:
- Active uploads are queued in the persistent outbox
- When connectivity returns, the outbox is automatically retried
- Failed uploads older than 30 seconds are retried on the next sync cycle
Getting Help
If you’re still experiencing issues:GitHub Issues
Report bugs or request features on the SDK repository.
Discussions
Ask questions and get help from the community.
- Xcode version
- SDK version
- iOS version and device model
- Relevant logs from
onLogcallback - Steps to reproduce

