I'm writing an application that needs once in a while to update the server about the user's location while the application is running in the background. I know I can do this by using the setKeepAliveTimeout:handler: method. I know that this method is specially for VoIP application but I was wondering if Apple will allow this usage for location update to server?
2 Answers
You don't need this setKeepAliveTimeout
.
I recommend to read this Apple's officatin documentation: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html
One of the things, which iOS provide is a callback on a location change. Your application will be awoken for short period of time and you will receive this callback and should be able to send your location to the server.
BTW. You will need location
backgrounding mode for this.
And progmr is right. You will need voip backgrounding mode to use setKeepAliveTimeout. And if your application isn't a real voip application, almost guaranteed that your app will be rejected.

- 22,758
- 18
- 92
- 184
The documentation says that your handler only get 10 seconds to keep the network connection alive for voip calls when using setKeepAliveTimeout:handler:
method. See this answer.
This call is for voip apps and you must have voip
in your UIBackgroundModes
key (info.plist). Using this would probably get rejected unless you are writing a voip app.