When is HealKit data accessible given that the phone is locked?

I have a strange "problem" I can't understand. In the documentation for HealKit the following is said:


"As a result, you may not be able to read data from the store when your app is launched in the background..."

I have some trouble understanding to when it will work and when it will not (given that is says may not be able). I am using this feature and it seems to be working sometimes for some phones, and sometimes not on other phones.

Is there anything that talks about this in more detail? Given that is seems to work sometimes, even if the phone is locked. There has to be some requirements or something similar that decides if you are allowed to read even if the phone is locked.
Answered by Technology Evangelist in 647802022
The HealthKit datastore is locked when the device is locked. Perhaps the devices where you are getting background updates from HealthKit are using Face ID or Touch ID and actually unlocked but still on the "lock" screen, in Single App Mode, or set to never lock?

Either way, if you have reproducible case we'd love to have a feedback report.

–M
Accepted Answer
The HealthKit datastore is locked when the device is locked. Perhaps the devices where you are getting background updates from HealthKit are using Face ID or Touch ID and actually unlocked but still on the "lock" screen, in Single App Mode, or set to never lock?

Either way, if you have reproducible case we'd love to have a feedback report.

–M
Thanks for the reply!

So in other words, you should never be able to get a reading from the HealKit datastore when the phone is locked?

I know Face ID is in the equation (because the phone it is working on uses that). I have to do some more investigation.
When is HealKit data accessible given that the phone is locked?
 
 
Q