Background Task
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// register bgTask while enter background mode
__block UIBackgroundTaskIdentifier bgTask = [application beginBackgroundTaskWithExpirationHandler:^{
[application endBackgroundTask:bgTask];
bgTask = UIBackgroundTaskInvalid;
}];
}Last updated