如何防止来自iOS应用程序的来电干扰(How to prevent disturbance from incoming phone call in iOS app)

系统教程 行业动态 更新时间:2024-06-14 17:01:31
如何防止来自iOS应用程序的来电干扰(How to prevent disturbance from incoming phone call in iOS app)

我有一个带下载功能的iOS应用程序。 它将文件下载到临时文件夹,然后将其移动到特殊文件夹。 但是这个过程可能会受到来电的干扰。 当应用程序在后台运行足够长时间时,下载过程可能会因系统杀死应用程序而消失。 我想知道是否有一个很好的策略来解决它。 我能想到的一个解决方案是检测来电并在应用再次启动时恢复下载。 你有什么建议吗? 谢谢!

I have an iOS app with downloading function. It downloads a file to a temporary folder and then move it to a special folder. But the process can be disturbed by an incoming phone call. When the app is in background for enough long time, the downloading process is gone maybe due to the system killed the app. I wonder if there is a good strategy for solving it. One solution that I can think is to detect the incoming phone call and resume the downloading when the app starts again. Do you have any suggestions? Thanks!

最满意答案

对于下载,您可以使用iOS 7中引入的后台传输服务 。即使您的应用程序被推送到后台并且下载需要很长时间,也可以继续下载。

如果需要,您还可以使用操作系统中的可能事件暂停/恢复下载。

For downloading you can use the background transfer service introduced in iOS 7. This allows the download to continue even if your application is pushed to background and the download takes a long time.

You can also pause/resume the download if needed using possible events from the OS.

更多推荐

本文发布于:2023-04-20 16:21:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/0e3d3b7c1627f2185493a6a6453c975d.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   干扰   如何防止   iOS   prevent

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!