I am badly in need of a background task to run always, when application is in background.
It is needed for a voip application. All steps are done for voip app.
I am using following script to run background task
- (void)applicationDidEnterBackground:(UIApplication *)application
{
UIApplication *app = [UIApplication sharedApplication];
UIBackgroundTaskIdentifier bgTask;
self.bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
[app endBackgroundTask:self.bgTask];
}];
}
After using it, when application goes to background, within 10 minutes if a sip call comes UILocalnotification
appear. but after 10 minutes if a sip call comes UILocalnotification did not appear.
Please anybody help me.