I've just implemented CallKit into our VOIP app but I'm struggling with getting the incoming call UI to show up.
In my experiment I just created a simple method that should show the incoming call UI, 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 actually get a call received
print out 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 no incoming call UI is shown. Is there something I'm missing?
Thanks
CallKit does not work in the iOS Simulator, so your app will need to be run on a device instead.
Also, I recommend comparing your app to the sample code app Speakerbox published by Apple to see if there are any pieces missing from your implementation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With