I'm having trouble with file download. My app is using AFURLSessionManager and make NSURLDownloadSessionTask by (NSURLSessionDownloadTask *)downloadTaskWithRequest:progress:destination:completionHandler:.
NSURLSessionDownloadTask *task = [[DownloadTask sharedInstance] downloadTaskWithRequest:request
progress:nil
destination:nil
completionHandler: ^(NSURLResponse * _Nonnull response,
NSURL * _Nullable filePath,
NSError * _Nullable error) {
self.resumeData = error.userInfo[NSURLSessionDownloadTaskResumeData];
}];
It works nice usually but sometimes its download starts from the beginning when I change network. LTE->Wifi, Wifi->another Wifi, Wifi->LTE.
I tried to use resumeData but there's no error, so resumeData is nil, just start file download from the start again.
Can anyone give me a hint solve this situation?
Thank you for your help.