1

I have app which should to display pop-up window with some buttons after the each incoming or outgoing call.

App should running in background and using CTCallCenter class i should be able to detect incoming, or outgoing call (correct me if is not).

I found it here: Detecting the call events in ios

I would like to ask how to display custom pop-up windows with buttons after the each incoming, outgoing call. Is it possible? And if not, is possible to display any kind of notification with custom buttons (Something like custom notification message with button in the notification centre )?

Many thanks for any advice.

Community
  • 1
  • 1
redrom
  • 11,502
  • 31
  • 157
  • 264

2 Answers2

0

Try the callEventHandler of CTCallCenter:

self.callCenter = [[CTCallCenter alloc] init];
self.callCenter.callEventHandler = ^(CTCall* call) {
    if (call.callState == CTCallStateDisconnected) // call ended
    {
        NSLog(@"Call ended.");
        // Do whatever you want here
    }
};

Hint: Available since iOS 4

Raptor
  • 53,206
  • 45
  • 230
  • 366
0

If you can get the call center to call you back, and unless you've done something specific to trigger that I'm not sure you can as I think you only get an update when something else brings your app back to running in the background, then you can use UIUserNotificationSettings to set the actions which can be taken from your notification.

Wain
  • 118,658
  • 15
  • 128
  • 151