Hi,
Since iOS8, the NSUrlSession in background mode does not call this delegate method if the server does not respond.
-(void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
The download remains idle undefinitely.
This delegate is called on iOS7 with an error when the server does not respond.
I have the same problem when I set the device to plane mode during a download. It fails on iOS7 and stays idle whithout failing on iOS8+.
Do you have insight on this?
Thanks,
What timeout are you expecting to be obeyed here?
In general an NSURLSession background session does not fail a task if something goes wrong on the wire. Rather, it continues looking for a good time to run the request and retries at that time. This continues until the resource timeout expires (that is, the value in the
timeoutIntervalForResource
property in the NSURLSessionConfiguration object you use to create the session). The current default for that value is one week!
Share and Enjoy
—
Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"