Background task interval period in iOS 7

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?

+4
source share
1 answer

Read the iOS 7 release notes. This is new behavior. You cannot change it. ( rmaddy )
It's exactly 180 s so 3min (not 2min) :) ( Gros )

Note
For the sake of maintaining order, I followed the answer to this question: What to do with questions that were resolved as a comment instead of an answer? (tagged community wiki)

+1
source

Source: https://habr.com/ru/post/1502293/


All Articles