Hi,
before installing iOS 15 our app received HKObserverQuery calls in background, which worked like a charm - the calls have reliably woken up our app in background, enabling it to process new HK data.
In iOS 15 the new entitlement com.apple.developer.healthkit.background-delivery
was added, being mandatory if HKObserverQuery calls should be delivered in background. Indeed, we added the entitlement to the Entitlements file and the Provisioning Profile of the app.
After doing so, registering with enableBackgroundDelivery(for:frequency:withCompletion:)
worked again without an error.
While testing we observed that the app is not called at all. To debug, we captured system logs of an iPhone with iOS 15 - you can find them attached.
It can be seen that HK background delivery tries to fire, but dasd decides to not proceed because of the ApplicationPolicy.After some research we found this might be related to background modes capabilities. Thus we added "Background fetch" and "Background processing". Anyhow, this did not change the behavior.
Again, this background delivery perfectly worked on iOS 14 - we did not change anything except adding the new background delivery entitlement (and the background processing entitlements in a second try).
Are we missing any (new?) entitlements? Any other news in iOS 15 making further changes necessary? Is HKObserverQuery working for others in background mode?
Thanks in advance for considering and best regards, Nils
Notes on the logs:
- App was suspended at all times
- iPhone was unlocked from the beginning on
- iPhone was locked at 13:16