4

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",timeInterval);
 });
}

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?

Alibaba
  • 352
  • 4
  • 14

1 Answers1

1

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

Note
For the sake of maintaining order, I followed the answer for this question: What to do with questions that have been self-resolved as a comment instead of an answer? (marked as community wiki)

Community
  • 1
  • 1
Gad
  • 2,867
  • 25
  • 35