I want to my app to keep running in the background with location services. For this I have used:
-(void)applicationDidEnterBackground:(UIApplication *)applic
I know this is very late for an answer. But if you still haven't got the answer, here is what I did and my app continuously runs in the background.
- (void)applicationDidEnterBackground:(UIApplication *)application
{
UIApplication *app = [UIApplication sharedApplication];
UIBackgroundTaskIdentifier bgTask = 0;
backgroundTimer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(backgroundTask) userInfo:nil repeats:YES];
bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
[app endBackgroundTask:bgTask];
}];
}
Now do whatever you want in the backgroundTask method.