CallPad를 내 Voip 응용 프로그램에 통합하려고합니다. Apple WWDC의 SpeakerBox 샘플 코드를 참조했습니다. ProviderDelegate 클래스를 만들고 reportNewIncomingCall
메서드를 호출 한 후 들어오는 호출 UI를 볼 수 있습니다.CXProviderDelegate 메서드가 트리거되지 않았습니다.
하지만 "응답"/ "종료"버튼을 누르면 해당 제공자 대리인이 해고되지 않습니다. 여기서 무엇이 잘못 될 수 있습니까?
CallProviderDelegate
을 인스턴스화하면 "providerDidBegin
"이 호출됩니다.
@implementation CallProviderDelegate
- (instancetype)init
{
self = [super init];
if (self) {
_providerConfiguration = [self getProviderConfiguration];
_provider = [[CXProvider alloc] initWithConfiguration:_providerConfiguration];
[_provider setDelegate:self queue:nil];
}
return self;
}
- (void)providerDidBegin:(CXProvider *)provider {
// this is getting called
}
- (void)provider:(CXProvider *)provider performAnswerCallAction:(CXAnswerCallAction *)action {
// this is not getting called when the Answer button is pressed
}
- (void)reportNewIncomingCallWithUUID:(nonnull NSUUID *)UUID handle:(nonnull NSString *)handle
completion:(nullable void (^)(NSError *_Nullable error))completion {
CXCallUpdate *update = [[CXCallUpdate alloc] init];
update.remoteHandle = [[CXHandle alloc] initWithType:CXHandleTypePhoneNumber value:handle];
update.hasVideo = NO;
[_provider reportNewIncomingCallWithUUID:UUID update:update completion:^(NSError * _Nullable error) {
completion(error);
}];
}
: 당신의 "발신자"클래스에서
CallProviderDelegate *providerDelegate = [[CallProviderDelegate alloc] init];
[providerDelegate reportNewIncomingCallWithUUID:[NSUUID UUID] handle:@"Raj" completion:^(NSError * _Nullable error) {
//
}];
예, 저는이 정확한 실수를하고 나중에 수정했습니다. 스레드 업데이트를 잊어 버렸습니다. 스튜어트에게 대답 할 시간을내어 주셔서 감사합니다. – Rajavelu
@Rajavelu : APp의 CallKit UI를 어떻게 가져올 수 있는지 알려주세요. –
@SaurabhPrajapati 공급자 위임자로부터 'reportNewIncomingCall'메서드를 호출해야합니다. – Rajavelu