本文介绍了如果应用程序被从任务管理器中杀死,NSUrlSession是否会继续文件传输?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试过网上的各种样本(最后一个是)为了更好地理解 NSUrlSession

I have tried various samples from the web (the last one being this one) in order to get a better understanding of NSUrlSession.

我希望看到的内容:文件下载即使触发它们的应用程序被杀死(例如由用户通过任务管理器),它仍将继续。但是这似乎没有发生。

What I was hoping to see: file downloads will continue even if the app that triggered them gets killed (for instance by the user through the task manager). However this does not seem to happen.

这是一个配置问题,或者如果应用程序被终止,后台文件传输不起作用?
我认为整个想法是iOS将重启应用程序。

Is this a configuration issue or does background file transfer not work if the app gets terminated?I thought the whole idea was that iOS will restart the app.

推荐答案

如果系统杀死你的应用程序和你的后台会话有活动下载,您的下载将继续,系统将在下载完成后启动您的应用。但是,如果用户强制退出您的应用,则会取消所有任务。

If the system kills your app and your background session has active downloads, your downloads will continue and the system will launch your app when the downloads complete. However, if a user force quits your app, all tasks get cancelled.

这篇关于如果应用程序被从任务管理器中杀死,NSUrlSession是否会继续文件传输?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 07:01