I have done an app using location update as background mode, and I am updating my location after each keepAlive interval using webservice. I am using the below mentioned code.
if ([application respondsToSelector:@selector(setKeepAliveTimeout:handler:)])
{
[application setKeepAliveTimeout:120 handler:^{
DDLogVerbose(@"KeepAliveHandler");
// Do other keep alive stuff here.
}];
}
self.bgTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
NSLog(@"ending background task");
[[UIApplication sharedApplication] endBackgroundTask:self.bgTask];
self.bgTask = UIBackgroundTaskInvalid;
}];
self.backgroundTimerForLocationUpdate = [NSTimer scheduledTimerWithTimeInterval:120
target:self
selector:@selector(changeAccuracy)
userInfo:nil
repeats:YES];
and in the location delegate I am calling a web request for updating the location in server, to track the user.
Will apple reject the app for using the location update background mode.