I’m facing an issue with iOS that I hope someone can help with. I developed an app a few years ago that records GPS tracks. Up until recently, everything worked fine—even when the app was running in the background, the recording continued without problems.
However, since releasing an update compiled after the iOS 18 release, users have reported that background tracking no longer works. I’ve reviewed the iOS documentation but haven’t found any relevant changes or solutions. Before the newly compiled release the app was working well on iOS 18 devices as well. Some users have reported that switching to the location permission from "When Using the App" to "Always" solved the issue. This is not the case for all users.
Has anyone else encountered this issue? Any recommendations or insights on how to resolve it would be greatly appreciated.
Below you can see the code used for the location tracking. Before the issue happened the app was compiled with XCode 15.4. Now I am using XCode 16.2
locationManager.activityType = CLActivityType.fitness
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.distanceFilter = 3
locationManager.allowsBackgroundLocationUpdates = true
locationManager.pausesLocationUpdatesAutomatically = false
if #available(iOS 11.0, *) {
locationManager.showsBackgroundLocationIndicator = true
}
locationManager.startUpdatingLocation()
if #available(iOS 17.0, *) {
// Create a CLBackgroundActivitySession object
backgroundActivitySession = CLBackgroundActivitySession()
}
Thanks in advance for your help!