Reputation: 729
Right now, my app is able to receive location updates in the background. However if the user forgets about it, and the app enters background while still receiving updates, it can in theory keep getting updates forever(i think?) until the user correctly turns it off.
Is there a way to set at timer to automatically stop the location manager, in case it is not shut down by the user?
Upvotes: 1
Views: 33
Reputation: 3366
You can use a background task with an expiration. Read more about it here: https://developer.apple.com/library/ios/DOCUMENTATION/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/UIApplication/beginBackgroundTaskWithExpirationHandler:
Upvotes: 1