-->

Newsstand restarts the download on Resuming

2019-08-13 04:04发布

问题:

I'm having difficulty in resuming the download using NewsstandKit.

The Download does starts in Background Mode but when App Resumes to Active Mode, The totalBytesWritten are changed to 0 and it starts the download again.

The Code works on Simulator, but fails on device.

I've been using the code from ios - newsstand-tutorial link.

Also the Sample code works perfectly,but when i assign my URL to it, the download breaks on resume.

Does it has to do some thing with the Server??

回答1:

I had this issue as well. My issue was that my settings were not properly configured for automatic downloads (and I never remember being prompted for this). Check under the "Store" section of the settings app and make sure that automatic background downloads are enabled for the app. After I did this, then the downloads would continue when the app went into the background instead of stopping and then restarting from the beginning when the app was made active again.



回答2:

Most likely, your server does not support resuming downloads the way Newsstand expects it to do.

Try watching the network traffic with a debugging proxy like Charles to find out which header fields the frameworks sends out and how your server responds.