When I try to start a basic NSURLSession transfer while the network is offline (air plane mode), with NSURLSessionConfiguration defaultSessionConfiguration and ephemeralSessionConfiguration, I of course immediately receive the NSError :
Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline."
But with NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier, the NSURLSession never returns, no response in any way, no timeout fired, it get stucked.
This happens with iOS 8.x. With iOS 7.x, I got the NSError as expected.
Why that ? Is there a way to get some error back ?
NSURLSession background transfer timeout not fired
612 views Asked by user3048615 At
1
So basically timeoutIntervalForRequest won't work in Background session but timeoutIntervalForResource will.
I got this answer from one of the members of Apple Staff at the developer forum. Also, I have verified this by implementing.