I am instantiating a NSURLSession
to do several background uploads like this:
sessionConfiguration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:myIdentifier];
Everything seems to work OK for the most part, but I am wondering if I need to add in the p.list the background Fetch key if all I am doing is background uploads and not downloads?. I am not able to find documentation saying that I should or that I should not. Specifically on XCode 5 +, I would like to know if under Capabilities>Background modes, I should enable or not background fetch, if all I am doing is background uploads, note that I do read the response after the upload is complete, which could be considered a "download".
The official guide Background Execution declare three type of background executions:
UIApplication
methodbeginBackgroundTaskWithName:expirationHandler:
to execute finite
time task.NSURLSession
to
download content. The NSURLSession
provided by your app is run on
separate system level daemon and when done, gets back to the app by
the completion handler. (Your above mentioned implementation)UIBackgroundModes
key mentioned in info.plist.So answering your question, you don't need the UIBackgroundModes
key, until you don't fall in the long-running tasks category.