The problem is that didCompleteWithError only reports a client-side error, otherwise nil. iOS doc said:
" .
, , - ,
, .
.
,
- URLSession:didBecomeInvalidWithError:
.
, NSURLSession :
NSURLSessionConfiguration *backgroundConfigurationObject = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:@"applycasession"];
self.backgroundSession = [NSURLSession sessionWithConfiguration:backgroundConfigurationObject delegate:self delegateQueue:[NSOperationQueue mainQueue]];
, :
[self.backgroundSession invalidateAndCancel]
, URL