Is "NSURLSessionDownloadTask" able to retry?

Hey,

Our "NSURLSessionDownloadTask" could fail under some circumstances. If our app is in foreground, then

(void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(nullable NSError *)error

will be called, we have an opportunity to retry manually.

But, if the app is in backend, we're not able to receive the callback until user set it to foreground.

Whether it's possible to retry immediately when the task fails even app is in backend? e.g. 1: Not sure we're able to set "NSURLSessionDownloadTask" automatically retry when it fails 2: Are we able to receive the failure callback immediately ( delay a couple of seconds/minutes are also acceptable ) even the app is in backend, and retry manually?

Thanks

NSURLSession will automatically retry (and even resume) downloads in background sessions.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is "NSURLSessionDownloadTask" able to retry?
 
 
Q