iOS应用程序未处于活动状态时下载 [英] iOS Background downloads when the app is not active

查看:156
本文介绍了iOS应用程序未处于活动状态时下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的应用程序最初下载时,用户需要下载一个大小的文件,如200MB(上限)。我绝对不能期望用户保持应用程序打开,直到此文件下载。所以他/她可能会关闭应用程序该应用程序将进入后台。

When my app is initially downloaded, the user needs to download a large file something like 200MB (upper limit). I definitely can't expect the user to keep the app open till this file is downloaded. So he/she might close the app & the app will go into background.

如何在这种情况下继续下载文件?这是甚至可能在iOS?

How can I continue to download the file in this scenario? Is this even possible in iOS?

推荐答案

开始下载是可以启动后台任务:

It is possible to start a background task when you begin the download:


正在转换到背景的应用程序可以要求额外的
时间完成任何重要的最后一分钟任务。

Apps that are transitioning to the background can request an extra amount of time to finish any important last-minute tasks.

在后台执行有限长度任务

然而,这样的任务被系统限制在不确定的执行时间量。但是,在这种情况下,200Mb的文件下载可能太大了。

However, such a task is limited to an undefined amount of execution time by the system. However, a 200Mb file download may be too large a task in this case.

这篇关于iOS应用程序未处于活动状态时下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆