Background location updates ceasing after a while

I am experimenting a funny issues on my app regarding the background updates I use to update the badge number on the basis of some objects thereby. In order to test it I invoked an url and saved the timestamp for the last access on a DB.

Basically the number keeps increasing for a while after I put the app in background to a certain point after some minutes cease updating altogether. I do not think the issue depends on the backgound enabling code, othewise the update would never occur in background.


So what might be the issue? Has anyone experienced the same behaviour and discovered something interesting?


Thanks, Fabrizio

Replies

Hi Fabrizio,


I am also experimenting this issue and I really do not know why...


I found these two resources:

- https://support.mapmyfitness.com/hc/en-us/articles/200117984-iPhone-GPS-Recording-Help

- https://support.strava.com/hc/en-us/articles/216917227-Strava-iPhone-app-and-Background-App-Refresh-setting


I do not understand why they are talking about Background Fetch since this is not related to Apple location service (not even discussed about in the documentation of CoreLocation)


Have you been able to fix it since you submitted your question here ?

I suspect those links are because the standard location service does not restart the app automatically if it is killed due to memory pressure or other reasons while in the background, and those developers are abusing background fetch to restart location updates.


If you use the significant location change service then your app will be restarted if the location changes. Or if you are using background fetch as noted, the OS *may* start your app once in a while whenever it feels like it. But background fetch is for fetching data from a server in order to display the latest info to your user when they open your app. You run the risk of rejection if using background fetch for some other purpose such as starting location updates. (And in fact the OS may detect that you're not fetching anything and stop waking you up - that is just conjecture on my part but is something they could easily do.)