iOS 应用程序在后台平均运行多长时间直到它被杀死? [英] How long iOS app runs in background in average until it's killed?

查看:1064
本文介绍了iOS 应用程序在后台平均运行多长时间直到它被杀死?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过 API 检查后端以进行应用设置更新,因此我不确定在启动时执行此类检查是否足够,或者我需要在应用进入前台后立即执行.当然,这取决于打开了多少应用程序,设备功能,但是关于应用程序在后台存活多长时间直到被杀死的一般规则是什么?一周?

I need to check backend via API for app settings update, therefore I'm not sure would it be sufficient to perform such check upon launching or I need to do as soon as app comes to the foreground. Of course it depends on how many apps are opened, device capabilities, but what is there a general rule about how long an app can survive in the background until it's killed? A week?

推荐答案

没有一般规则,不能给你任何时间近似值.此外,可能对您来说更重要的是系统可以为您提供多少时间用于后台获取,因为后台应用程序进入挂起状态.

There is no general rule and can not give you any time approximation. Moreover probably for you is more important how much time system can give you for a background fetch as in background app goes to suspended state.

如果我没记错的话,您可以在进入后台后请求的时间在 iOS 7 之前最多 10 分钟,在 iOS 7 上最多 180 秒,我还没有在较新版本上亲自检查过.无论如何,时间是不能保证的.

For the time you can request after going to background if I remember correctly before iOS 7 it was up to 10 minutes, on iOS 7 it was up to 180 seconds and I haven't checked it personally on newer versions. Anyway that time is not guaranteed.

这篇关于iOS 应用程序在后台平均运行多长时间直到它被杀死?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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