1

I am looking for a way to get CTCallCenter Events on an enterprise app while it is in the background. I came across the suggested solution by OhadM on this post: How to get a call event using CTCallCenter:setCallEventHandler: that occurred while the app was suspended?, but I can't get it to work with the app in the background.

I created a new single view app, added a callCenter property on the appDelegate and set the callEventHandler as shown in the post and listed below. I also added the Voice over IP and Background fetch Background Modes Capabilities as described.

Is there any other settings or code not mentioned in the solution that may help? I am using iOS 9.3.1 and Xcode 7.3.1.

[self.callCenter setCallEventHandler:^(CTCall *call)
     {
         NSLog(@"Event handler called");
         if ([call.callState isEqualToString: CTCallStateConnected])
         {
             NSLog(@"Connected");
         }
         else if ([call.callState isEqualToString: CTCallStateDialing])
         {
             NSLog(@"Dialing");
         }
         else if ([call.callState isEqualToString: CTCallStateDisconnected])
         {
             NSLog(@"Disconnected");

         } else if ([call.callState isEqualToString: CTCallStateIncoming])
         {
             NSLog(@"Incomming");
         }
     }]; 
Community
  • 1
  • 1
MikeC
  • 13
  • 4
  • were you able to find a solution to this? – ShayanK Jun 24 '16 at 10:15
  • Unfortunately, I was not. And because I do not have 50 Stack Overflow points, I was not able to get clarification on OhadM's solution referenced above (which I could not get to work). Maybe you can ask on that thread? – MikeC Jun 28 '16 at 19:04
  • Possible duplicate of [CTCallCenter - Call Event Handler - in background state](http://stackoverflow.com/questions/10102108/ctcallcenter-call-event-handler-in-background-state) – nverinaud Aug 30 '16 at 14:56

0 Answers0