background task interval period in IOS 7
I Have the following code in the appdidEnterBackground() and I see that in
IOS 6 I see that the background time period is approx 10 mins and the same
code in IOS 7 is printing 2 mins.
Here's 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",remainingTime);
});
}
Question is: How can I increase my background time period from 2 mins to
approx 10 mins in IOS 7? Is there anything I am missing?
No comments:
Post a Comment