Hello Apple Developer Support / Community,
I would like clarification regarding HealthKit data access behavior when an iPhone is locked.
We are building an app that uses:
- HKObserverQuery
- enableBackgroundDelivery
- HKAnchoredObjectQuery
- Background execution to sync HealthKit data to our server
Our specific question is: When the device is locked with passcode/Face ID protection enabled, can an app launched in the background through HKObserverQuery or other background mechanisms reliably access and read HealthKit data?
We would like to understand the expected Apple-supported behavior for the following scenarios:
- If new HealthKit samples are written while the phone is locked, will HKObserverQuery still trigger immediately?
- If the observer callback is invoked while locked, can HKAnchoredObjectQuery successfully read the new samples?
- Is HealthKit data inaccessible while locked due to Data Protection / encrypted store behavior?
- Should developers expect delivery or data reads to be deferred until the user unlocks the device?
We are trying to set correct expectations for background syncing and would appreciate official clarification on whether near real-time HealthKit sync is possible while the device remains locked.
Relevant documentation mentions HealthKit store encryption, but we would appreciate direct confirmation for production behavior.
Thank you.