I\'m looking for a way to get a background location update every n minutes in my iOS application. I\'m using iOS 4.3 and the solution should work for non-jailbroken iPhones
Unfortunately, all of your assumptions seem correct, and I don't think there's a way to do this. In order to save battery life, the iPhone's location services are based on movement. If the phone sits in one spot, it's invisible to location services.
The CLLocationManager
will only call locationManager:didUpdateToLocation:fromLocation:
when the phone receives a location update, which only happens if one of the three location services (cell tower, gps, wifi) perceives a change.
A few other things that might help inform further solutions:
Starting & Stopping the services causes the didUpdateToLocation
delegate method to be called, but the newLocation
might have an old timestamp.
Region Monitoring might help
When running in the background, be aware that it may be difficult to get "full" LocationServices support approved by Apple. From what I've seen, they've specifically designed startMonitoringSignificantLocationChanges
as a low power alternative for apps that need background location support, and strongly encourage developers to use this unless the app absolutely needs it.
Good Luck!
UPDATE: These thoughts may be out of date by now. Looks as though people are having success with @wjans answer, above.