You can do a 10 min background activity in pre iOS7 like save some thing to your server but in order to wind up when background activity is about to be closed you need to use this in your - (void)applicationDidEnterBackground:(UIApplication *)application
- (void)applicationDidEnterBackground:(UIApplication *)application
{
bgTask = [application beginBackgroundTaskWithExpirationHandler:^{
// Clean up any unfinished task business by marking where you
// stopped or ending the task outright.
[application endBackgroundTask:bgTask];
bgTask = UIBackgroundTaskInvalid;
}];
// Start the long-running task and return immediately.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// Do the work associated with the task, preferably in chunks.
[application endBackgroundTask:bgTask];
bgTask = UIBackgroundTaskInvalid;
});
}
For more detail look here
the summary is
- your - (void)applicationDidEnterBackground:(UIApplication *)application method must return within 5 seconds or else your app will be purged.
- you can how ever ask for more time using the above method the time allowed in practice is 10 mins