Well, Actualy it depend on task what you want to perform. Main point is you cant perform any task in Background permanently. at the interval of time you need to request.
You can perform few task in background like Downloading and etc. You need to use dispatch_async
Something like in - (void)applicationDidEnterBackground:(UIApplication *)application
- (void)applicationDidEnterBackground:(UIApplication *)application
{
bgTask = [application beginBackgroundTaskWithName:@"MyTask" expirationHandler:^{
// 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 like finite task , you can find on apple's document in below link.
BackgroundExecution
You can also get more help regarding background services from below link.
running-background-services-in-ios