如果setKeepAliveTimeout方法设置为15分钟,则VOIP应用程序不会及时唤醒 [英] VOIP app is not wake up in time if set 15 min for setKeepAliveTimeout method

查看:520
本文介绍了如果setKeepAliveTimeout方法设置为15分钟,则VOIP应用程序不会及时唤醒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了应该每15分钟处理一些数据的应用程序。所以我在插件文件中添加了voip标志。并使用setKeepAliveTimeout 900秒(15分钟)。还添加了处理某些数据的后台任务功能。
处理数据最多需要10秒。

I've developed app which should process some data every 15 min. So I added voip flag into plist file. And use setKeepAliveTimeout with 900 sec(15 min). Also added background task functionality which processes some data. Processing of data takes up to 10 seconds.

问题是应用程序没有及时唤醒。有时在12分钟后,有时在16分钟后等。但我需要在15分钟内完成。

The problem is that app wakes up NOT in time. Sometimes after 12 min, sometimes after 16 min etc. But I need exactly in 15 min.

如何解决以下问题?

iOS版本是5.0 +

iOS version is 5.0+

如果是iOS的具体内容,请向我提供苹果公司api文件的官方参考资料。

If it's iOS's specific please provide me official reference into the apple's api document where this mentioned .

推荐答案

setKeepAliveTimeout:handler:不是通用间隔调度程序。它允许您在提供的处理程序的调用之间设置最大间隔。该功能的目的是帮助您防止连接超时或落后于您的VOIP应用程序标准(对于在线/离开状态等)。

setKeepAliveTimeout:handler: is not a general purpose interval scheduler. It allows you to set the maximum interval between invocations of the supplied handler. The purpose of the function is to help you keep your connections from timing out or falling behind your VOIP applications standards (for things like online/away status).

所以第一个参数( timeout )告诉iOS在中调用您的处理程序不超过 15分钟。如果操作系统决定在12分钟时有一些剩余的周期,它可能会调用你的处理程序。或者在7分钟或15分钟内。

So the first parameter (timeout) tells iOS to call your handler in no more than 15 minutes. If the OS decides that it's got some cycles to spare at 12 minutes, it might call your handler. Or in 7 minutes, or 15.

如果您需要对间隔进行更精细的控制,则应设置较小的超时窗口,并忽略对于不重要的调用。您。但调用仍然是相当不规则的。

If you need finer grained control of the interval, you should set a smaller timeout window and just ignore invocations that aren't important to you. But the invocations will still going be fairly irregular.

http://developer.apple.com/library/ios/#documentation/UIKit/Reference/ UIApplication_Class / Reference / Reference.html#// apple_ref / occ / instm / UIApplication / setKeepAliveTimeout:handler

一般情况下,目前无法让它按照精确的时间表唤醒你的应用程序。您必须遵守iOS有限的后台处理选项,所有这些选项都旨在为操作系统提供大量余地来管理所有流程的总体优先级和资源需求。

In general, there is currently no way to make it wake your app on a precise schedule. You must adhere to iOS' limited background processing options, all of which are designed to give the OS a lot of leeway to manage overall priorities and resource needs across ALL processes.

这篇关于如果setKeepAliveTimeout方法设置为15分钟,则VOIP应用程序不会及时唤醒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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