I have an app that tracks user location for mileage, and it currently uses CLLocationManager for starting and stopping location updates. I’ve recently started working with CLBackgroundActivitySession and have some questions regarding how it interacts with CLLocationManager.
My Questions:
- Can I create and start a CLBackgroundActivitySession after calling
startUpdatingLocation()? Will they work together? - What happens if I stop location updates but don’t end the session? Will iOS suspend
the app or keep it running in the background? - Conversely, what if I end the session but don’t stop the location updates? Will this cause any issues, such as the app continuing to consume resources
unnecessarily in the background?
In short, I just want to replace the background task logic the keeps the app alive in the background with the session but don’t want to change my current SDK code for managing location updates.
I don’t want to use the CLLocationUpdate.liveUpdates().