2

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?

Alex1987
  • 9,397
  • 14
  • 70
  • 92

1 Answers1

6

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.

David Neiss
  • 8,161
  • 2
  • 20
  • 21
  • Yeah it's probably what it should be, but do you know of any ways to present some kind of a notification on top of the call screen? I have tried to do it with UIAlertView, but it didn't get presented, because the app wasn't visible. – Alex1987 Apr 26 '11 at 14:53
  • How about trying to create a local notification? That will present modally, like an AlertView and give users the change to ignore it and bring your app to foreground. – David Neiss Apr 26 '11 at 16:05