Checking incoming call in iphone

烂漫一生 提交于 2019-11-28 05:02:21

问题


I have read about the CoreTelephony class and in this CTClass can check caller and find state of call....

But when and how to use this......

I think my application goes to background when call start..
help please or correct me......


回答1:


It is not possible with the official SDK. The best that you can do is determine if the user is on a call. You can do this by inspecting the size of the status bar frame.

[UIApplication sharedApplication].statusBarFrame



回答2:


If your asking if you can track phone calls in the background, you can't in all situations.

If you want to know if, at any point in time, when your running, you can. You can access the 'CTCallCenter' currentCalls property and it will give you the state of the call at that point in time.

If you want to track if a incomming call the cause of your application going to the background, you can use the 'CTCallCenter' callEventHandler property.




回答3:


Not quite sure what you're trying to accomplish but after the call ends the user should automatically be brought back to the app.




回答4:


It's not possible to get this information with the current SDK, most likely for privacy reasons. I'd recommend filing a feature request with Apple (http://radar.apple.com) however, I doubt it's something they're likely to include in the future.



来源:https://stackoverflow.com/questions/4601354/checking-incoming-call-in-iphone

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