Ranjeet Sajwan
Ranjeet Sajwan

Reputation: 1921

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

Upvotes: 3

Views: 3131

Answers (4)

Shane Powell
Shane Powell

Reputation: 14148

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.

Upvotes: 2

David
David

Reputation: 14404

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

Upvotes: 4

Brandon Schlenker
Brandon Schlenker

Reputation: 5088

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.

Upvotes: 0

Michael Savage
Michael Savage

Reputation: 46

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

Upvotes: 0

Related Questions