Healthkit background delivery when app is not running

The background deliver works perfectly when the app is in the background or suspended states. However, when the app is killed (terminated state), the background task does not execute

Answered by DTS Engineer in 826759022

I believe this is an as-designed behavior. In most cases, the system does not relaunch an app after it's force quit (meaning that the user removes the app from the multitasking UI), because force quitting an app is interpreted as a strong sign that the user doesn’t want it running.

This rule has some exceptions, but HealthKit background deliver isn't one of them.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Accepted Answer

I believe this is an as-designed behavior. In most cases, the system does not relaunch an app after it's force quit (meaning that the user removes the app from the multitasking UI), because force quitting an app is interpreted as a strong sign that the user doesn’t want it running.

This rule has some exceptions, but HealthKit background deliver isn't one of them.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Thank you for addressing my question. Would it be possible to send a reference documentation link to share it with my team? Thanks,

I can't find anything in today's documentation unfortunately.

If I remember correctly, the behavior was documented in a documentation named iPhoneOS Programming Guide when background execution was first introduced many years ago. We re-organized the whole documentation in recent years, and that bit of information was gone after that.

Please feel free to file a feedback report against no formal documentation of the behavior though – If you do so, please share your report ID here and I can route it directly to the documentation team.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Appreciate your response! Many online forms indicate that the background works when app in terminated. However that might be in an earlier release of iOS. https://stackoverflow.com/questions/26375767/healthkit-background-delivery-when-app-is-not-running

Can we send a hidden notification to wake up the app and execute background delivery?

Healthkit background delivery when app is not running
 
 
Q