Newsstand restarts the download on Resuming

送分小仙女□ 提交于 2020-01-05 04:40:30

问题


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.



来源:https://stackoverflow.com/questions/8034880/newsstand-restarts-the-download-on-resuming

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!