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
source share