Resume downloading after killing or placing in the background of the application

I have some problems when I want to resume the download operation. I am using Alamofire 4.4 and I have tested on iOS 9 and 10. Here are my use cases:

1- The download operation is performed, I cancel the request ( resumeDatagenerated and saved), and then I put the application in the background. After restarting the application, I resume the download (using resumeData) several times when the download resumes and sometimes restarts. Is this normal behavior? And is there a solution, if not?

2- The download operation is in progress and I am killing the application. The downloaded data seems to be lost, and I cannot resume the download. Is there any solution to get resumeData and resume loading after restarting the application?

Thank.

+4
source share
2 answers

Finally, I updated the download module using URLSession. Now my application is more stable.

0
source

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

0
source

Source: https://habr.com/ru/post/1675332/


All Articles