How to handle session when a call is received

吃可爱长大的小学妹 提交于 2019-12-24 09:39:04

问题


Please can you tell me how to handle session when a call is received.

Actually I'm playing with an online radio station and I want to resume that after call has ended.


回答1:


To add core telephony notification to your program, include the following code and compile linking to the Core Telephony framework. This code adds your program as a registered observer.

id ct = CTTelephonyCenterGetDefault();
CTTelephonyCenterAddObserver(ct, NULL, callback, NULL, NULL, CFNotificationSuspensionBehaviorHold);

To monitor the incoming notifications, you need to build the callback routine you supplied as an argument to the add observer call:

static void callback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)
 { ... }

For more plz read Programmatically Handling iPhone interruptions



来源:https://stackoverflow.com/questions/5416330/how-to-handle-session-when-a-call-is-received

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!