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.
I tried / considered following options:
Found a solution to implement this with the help of the Apple Developer Forums. I did the following:
location background mode
NSTimerin the background by using
nis smaller than
UIApplication:backgroundTimeRemaining,it will work just fine, in case
nis larger, the
location managershould be enabled (and disabled) again before there is no time remaining to avoid the background task being killed.
This does work since location is one of the three allowed types of background execution.
Note: Did loose some time by testing this in the simulator where it doesn't work, works fine on my phone.