Limitation is as following:
- 10 mins for iOS6
- 3 mins for iOS7
Just in your app delegate implement:
- (void)applicationDidEnterBackground:(UIApplication *)application {
UIApplication *app = [UIApplication sharedApplication];
__block UIBackgroundTaskIdentifier bgTask = 0;
bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
[app endBackgroundTask:bgTask];
bgTask = UIBackgroundTaskInvalid;
}];
}
After 600s (iOS6) or 180 s (iOS7) the expiration handler is called - you have to finish immediately - no chance for any time consuming task or app will crash.