Checking incoming call in iphone

2019-01-26 20:20发布

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......

标签: iphone ios4 call
4条回答
在下西门庆
2楼-- · 2019-01-26 20:56

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.

查看更多
Evening l夕情丶
3楼-- · 2019-01-26 21:04

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.

查看更多
ら.Afraid
4楼-- · 2019-01-26 21:12

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

查看更多
够拽才男人
5楼-- · 2019-01-26 21:15

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
查看更多
登录 后发表回答