Alex1987
Alex1987

Reputation: 9457

iphone: notification when receiving a call?

I'm developing for a jailbroken device, and I want to create an app that detects a phone call, and presents an alert on top of the call screen. How can I achieve this? What hidden frameworks should I use?

Upvotes: 2

Views: 1678

Answers (1)

David Neiss
David Neiss

Reputation: 8237

Within CoreTelephony is the CTCallCenter class which includes the callEventHandler property, which is a block that runs upon changes in the call state. As described in the documentation, you could use this to become notified of these states:

CTCallStateDialing;
CTCallStateIncoming;
CTCallStateConnected;
CTCallStateDisconnected;

Docs say you must be in active app state. If you are suspended, then you only get one block state change notification upon waking up. If you are jailbroken and in background state, hopefully you would get your block executed, so you could become aware of this.

Upvotes: 6

Related Questions