I have the following code in appdidEnterBackground (), and I see that in IOS 6 I see that the background time period is about 10 minutes, and the same code in IOS 7 prints 2 minutes.
Here is the code:
-(void)applicationDidEnterBackground:(UIApplication *)application { backgroundTaskIdentifier = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ [[UIApplication sharedApplication] endBackgroundTask:backgroundTaskIdentifier]; backgroundTaskIdentifier = UIBackgroundTaskInvalid; }]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSTimeInterval timeInterval = [[UIApplication sharedApplication] backgroundTimeRemaining]; NSLog(@" time remaining in background = %f",timeInterval); }); }
Question: how can I increase my background period from 2 minutes to 10 minutes in iOS 7? Is there something I can't see?
source share