简体   繁体   中英

Checking incoming call in iphone

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

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

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.

不太确定你想要完成什么但是在通话结束后,用户应该自动被带回应用程序。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM