我阅读了有关背景提取的所有Apple文档,目前我正在使用它:
I read all Apple documentation about background fetch and currently I'm using it like this:
[[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:minimumBackgroundFetchInterval];我让操作系统决定何时执行后台提取,但如果我这样设置:
I let OS to decide when to perform background fetch, but if I set it like this:
[[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:21600];这是否意味着每6小时会进行一次获取?
Does that mean that fetch will happen every 6h?
推荐答案不,这意味着您建议iOS在执行后台提取之前至少要经过六个小时,但此属性的文档说明了 -
No, it means that you are suggesting to iOS that at least six hours should elapse before a background fetch is performed, but the documentation for this property states -
可以启动另一个后台提取之前必须经过的最小秒数。此值仅供参考,并不表示获取操作之间预期的确切时间。
The minimum number of seconds that must elapse before another background fetch can be initiated. This value is advisory only and does not indicate the exact amount of time expected between fetch operations.
因此,在执行后台提取之前可能需要超过六个小时,但可能不会更少。 iOS还会记录您通过完成处理程序返回的值,指示是否有新数据可以尝试确定您的应用可能有新数据的当天时间。
So, it could be more than six hours before a background fetch is performed but probably won't be any less. iOS also takes note of the value you return via the completion handler indicating whether there was new data or not to try and determine the times of the day when there is likely to be new data for your app.
更多推荐
iOS后台获取自定义间隔
发布评论