iOS location recording issues iOS 18

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!

Edit: I already tried to fix the issue using CLBackgroundActivitySession, but this did not make a difference.

Considering CLBackgroundActivitySession has just been introduced on iOS 17, and you say "I developed an app a few years ago" you may have more changes to your code than you are letting on.

Even without code changes, while your app may be tripping on some small behavioral changes that may have been introduced in the years since you have developed the app, there has not been any categorically differences in CoreLocation behavior recently, outside of introducing a whole new set of APIs in iOS 17/18, but unless you are using those (like CLBackgroundActivitySession itself), there aren't changes that should break your app altogether.

Unfortunately, "background tracking no longer works" is not a helpful diagnostic information. What exactly is failing? Under what conditions? Which CoreLocation APIs are you using to track location? Are you aware certain APIs will not work at all with when-in-use authorization and requires Always? Is the tracking not working at all, or is it stopping after a while? What are the conditions of that, is the app crashing? The suers are turning on/off some functionality? Are they force quitting your app?

Once you have this kind of information, you may find it easier to diagnose what exactly might be failing, and what exact APIs might be causing any issues.


Argun Tekant /  DTS Engineer / Core Technologies

iOS location recording issues iOS 18
 
 
Q