We are developing a mileage tracking application that depends on continuous background location updates on iOS.
Our app has the required background modes enabled:
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
<string>processing</string>
<string>fetch</string>
<string>location</string>
</array>
We are observing inconsistent behavior with background location tracking in app terminated state.
In some cases, after a period of time, location updates stop completely. Sometimes iOS successfully relaunches the app when movement is detected and location updates resume correctly. However, in other cases, the app is not relaunched by the system, and we stop receiving location updates entirely.
We reviewed Apple’s documentation on handling background location updates:
https://developer.apple.com/documentation/corelocation/handling-location-updates-in-the-background
Based on our observations, we would appreciate clarification on the following points:
Is this considered expected iOS behavior or a system limitation?
Under what conditions does iOS decide not to relaunch a terminated app for location events?
Are there recommended best practices to improve the reliability of background location relaunch behavior?
Is there any logging, diagnostics, or debugging mechanism available to determine why the app was not relaunched?
Apple’s documentation mentions that location updates may be queued while the app is terminated and later delivered after relaunch. However, in some scenarios we do not receive those queued updates after the app restarts. Under what conditions can queued location updates be discarded or not delivered?
Additional notes:
We are using standard Core Location background updates.
“Always” location permission is granted.
Background App Refresh is enabled.
The issue is observed intermittently across multiple iOS devices.
Topic:
Programming Languages
SubTopic:
General
Tags:
Swift
Core Location
Maps and Location
Background Tasks
0
0
24