I am converting an existing VoIP application to Callkit. I have a lot of code in place but somehow when I initialize the CXProvider it will call providerDidBegin and immediately after that it will call providerDidReset. It doesn't give a reason for that. I cannot register one of my outgoing phone calls after that because my provider isn't active.
I have tried looking into certificates, settings and so on but basically I don't need more than I already have for my VoIP app it seems.
The call from CallKit calling the reset method is the following:
CallKit`__42-[CXProvider handleConnectionInterruption]_block_invoke:
When I dig deeper where it comes from, it's NSXPCConnection related. What is this connection and how do I need to set it up?
Of course there is no interruption in the connection.
This is how I initialize my Delegate:
- (id)init {
self = [super init];
self.configuration = [[ProviderConfiguration alloc] init];
self.provider = [[CXProvider alloc] initWithConfiguration:self.configuration];
[self.provider setDelegate:self queue:dispatch_get_main_queue()];
return self;
}
This is what the configuration looks like:
- (instancetype)init {
self = [super initWithLocalizedName:@"MyCompany"];
self.supportsVideo = NO;
self.maximumCallsPerCallGroup = 1;
self.supportedHandleTypes = [[NSSet alloc] initWithObjects:[NSNumber numberWithInt:(int)CXHandleTypePhoneNumber], nil];
self.maximumCallGroups = 1;
self.maximumCallsPerCallGroup = 5;
return self;
}
Both callbacks are implemented:
- (void)providerDidBegin:(CXProvider *)provider {
NSLog(@"Begun");
}
- (void)providerDidReset:(CXProvider *)provider {
NSLog(@"Reset");
}