CTCallCenter - 呼叫事件处理程序 - 在后台状态 [英] CTCallCenter - Call Event Handler - in background state

查看:974
本文介绍了CTCallCenter - 呼叫事件处理程序 - 在后台状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于苹果的文档有没有办法来处理手机状态而应用程序挂起:
<一href=\"http://developer.apple.com/library/ios/#DOCUMENTATION/NetworkingInternet/Reference/CTCallCenter/Reference/Reference.html\" rel=\"nofollow\">http://developer.apple.com/library/ios/#DOCUMENTATION/NetworkingInternet/Reference/CTCallCenter/Reference/Reference.html

Regarding the Apple documentation there is no way to handle the phone state while the app is suspended : http://developer.apple.com/library/ios/#DOCUMENTATION/NetworkingInternet/Reference/CTCallCenter/Reference/Reference.html

"While it is suspended, your application does not receive call events"

这是同样适用的背景的状态? (作为背景状态不与悬浮关于应用程序状态的苹果文档中描述的状态相同)

Is this also true for the "background" state? (As the background state is not the same with the "suspended" app state regarding the states described in the Apple documentation)

<一个href=\"http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html\" rel=\"nofollow\">http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html

我用下面的code办理手机状态:

I'm handling the phone state using the following code :


CTCallCenter *callCenter = [[CTCallCenter alloc] init];

callCenter.callEventHandler=^(CTCall* call)
{

  //call state

};

我曾经为了是否会接到一个电话事件,而我的应用程序是在后台的状态,但不执行该块接缝处增加了一个本地通知到callEventHandler块(我的应用程序有一个后台支持和收到的所有事件(通过TCP)的正确处理,而应用程序是在后台)

I have added a local notifications into the callEventHandler block in order to check if a call events will be received while my app is in background state but is seams that the block is not executed ( my app has a background support and all received events (via TCP) are handled correctly while the app is in background )

任何帮助AP preciated!

Any help is appreciated!

感谢

推荐答案

这是我做过的任何使用我不能接收所有的测试,当应用程序在 callEventHandler 背景。但是,当应用程序在前台,均能正常工作。

All tests that I've done I can't receive any using callEventHandler when the application is in background. But, when the application is in foreground, all nicely work.

插座的作品,因为iOS应用会为您整理并提供相应的packtes。但对于这一点,你需要创建一个VOIP插座,并添加 VOIP UIBackgroundModes 您的应用 - 信息的.plist

The socket works, because iOS handles it for you app and deliver the packtes accordingly. But for that, you need to create a voip socket and add voip to UIBackgroundModes to your App-Info.plist.

这篇关于CTCallCenter - 呼叫事件处理程序 - 在后台状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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