Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resume download after killing or putting on background the application

I have some issues when I want to resume a download operation. I am using Alamofire 4.4 and I made my tests on iOS 9 and 10. Here is my use cases:

1- A download operation is in progress, I cancel the request (resumeData is generated and saved) and then I put the application on background. After relaunching the application, I resume the download (using the resumeData) some times the download is being resumed and sometimes is being restarted. Is it a normal behaviour ? And are there any solution if not ?

2- A download operation is in progress, and i kill the application. Downloaded data seems to be lost and I can't resume the download. Is there any solution to get the resumeData and resume the download after restarting the application ?

Thank you.

like image 870
Mourad Brahim Avatar asked Nov 26 '22 14:11

Mourad Brahim


1 Answers

This may not be a direct answer for your question but you should definitely check those: http://benscheirman.com/2016/09/designing-a-robust-large-file-download-system/ and http://benscheirman.com/2016/10/background-downloads/

like image 135
Mike Mikina Avatar answered Nov 30 '22 23:11

Mike Mikina