I'm confused at whether Background Transfer Service is supports for NSURLSessionDataTasks under iOS 8+?
Data tasks are supported in a background session in iOS 8 and later, but there are important caveats. Specifically, a data task only makes sense if your app is running. If your app moves to the background and then gets suspended, the data task will fail. This is a pretty severe limitation, although there’s at least one interesting use case (described below).
what happens if a SessionTask fails while using Background Transfer Service?
For download tasks, the system will attempt to retry the download until the timeout expires (specified by the
timeoutIntervalForResourceproperty of the configuration you use to create the session). Upload tasks can’t be retried because they are assumed to not be idempotent. Once all the tasks in the session are done, your app will be resumed and the state of each task reported to you via delegate callbacks.
One case where data tasks in a background session are useful relates to requests that might become download tasks. You can start the request as a data task and then, in
-URLSession:dataTask:didReceiveResponse:completionHandler:, look at the response and decide whether you want the request to stay as a data task or become a download task.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"