I have a problem when it comes to a slow backend and downloading data with background configuration.
NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration backgroundSessionConfiguration:identifier];
_backgroundSession = [NSURLSession sessionWithConfiguration:sessionConfig delegate:self delegateQueue:nil];
NSURLSessionDownloadTask *downloadTask = [_backgroundSession downloadTaskWithURL:URL];
[downloadTask resume];
If the connection is astablished but it takes more than 60 seconds for it to send back data a timeout occurs. That is fine. However the behaviour I experience is that I don't get an Error. The Session just sends out a new request. "Give me data again". I have no idea where this happens. Not in my code and no delegate methods are called that I'm aware of. I just have access to the server logs. It takes the server roughly 68 seconds to send back data but the app just ignores it because it's waiting for the new request.
One solution is to increase the timeout value. But I don't like it and it only works for iOS 7. Not iOS 8.
sessionConfig.timeoutIntervalForRequest = 10 * 60.0;
Does anyone have any insight in this? I found this link about timeout issue for background session here on stackoverflow. It's 10 months old but no solutions, only people agreeing.