IOS 10 Callkit does not display incoming call user interface

I just implemented CallKit in our VOIP application, but I'm afraid to get an incoming call interface.

In my experiment, I just created a simple method that should display the interface of an incoming call, see below:

CXProviderConfiguration * configuration = [[CXProviderConfiguration alloc] initWithLocalizedName:@"Bitcall"]; CXProvider *callkitProvider = [[CXProvider alloc] initWithConfiguration: configuration]; [callkitProvider setDelegate:self queue:nil]; CXCallUpdate *update = [[CXCallUpdate alloc] init]; update.localizedCallerName = @"Ravadam Patel"; [callkitProvider reportNewIncomingCallWithUUID:[NSUUID UUID] update:update completion:^(NSError * _Nullable error) { if (error) { NSLog(@"Error: %@", error); } }]; 

Everything seems to be working fine, and I really get a printout of a call received with this code:

 - (void)handleCall { self.callCenter.callEventHandler = ^(CTCall *call){ if ([call.callState isEqualToString: CTCallStateConnected]) { //NSLog(@"call stopped"); } else if ([call.callState isEqualToString: CTCallStateDialing]) { } else if ([call.callState isEqualToString: CTCallStateDisconnected]) { NSLog(@"Call ended"); } else if ([call.callState isEqualToString: CTCallStateIncoming]) { NSLog(@"Call received"); } }; } 

But the user interface of the incoming call is not displayed. Is there something I'm missing?

thanks

+5
source share
1 answer

CallKit does not work in iOS Simulator, so your application will need to run on the device.

In addition, I recommend comparing your application with the Speakerbox sample code published by Apple to see if any fragments from your implementation are missing.

+7
source

All Articles