I add long running task in Capabilities like 'background fetch' and add this code. Will it ok and I will have updates during all background app life?
- (void)applicationDidEnterBackground:(UIApplication *)application
{
UIApplication *app = [UIApplication sharedApplication];
UIBackgroundTaskIdentifier bgTask = 0;
bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
[app endBackgroundTask:bgTask];
}];
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(backgroundUpdate) userInfo:nil repeats:YES];
[timer fire];
}