我正在实现一个 VoIP 应用程序,在那里我为来电处理了远程方,例如
- (NSUUID *)reportIncomingCallWithContactIdentifier:(NSString *)identifier name:(NSString *)name telNumber:(NSString *)telnum completion:(ADCallKitManagerCompletion)completion {
NSUUID *callUUID = [NSUUID UUID];
CXCallUpdate *callUpdate = [[CXCallUpdate alloc] init];
//callUpdate.callerIdentifier = identifier;
callUpdate.localizedCallerName = name;
callUpdate.supportsHolding = NO;
callUpdate.supportsUngrouping = NO;
callUpdate.supportsGrouping = NO;
callUpdate.remoteHandle = [[CXHandle alloc] initWithType:CXHandleTypePhoneNumber value:telnum];
[self.provider reportNewIncomingCallWithUUID:callUUID update:callUpdate completion:completion];
return callUUID;
}
结果,来电显示在最近的电话列表中。但是当我拨出电话时,该号码未显示在最近通话列表(系统的电话应用程序)中。当前实施:
- (NSUUID *)reportOutgoingCallContactIdentifier:(NSString *)identifier destination:(NSString *)name telNumber:(NSString *)telnum completion:(ADCallKitManagerCompletion)completion {
NSUUID *callUUID = [NSUUID UUID];
//MARK::change in constructor, defined new handler
CXHandle *handle = [[CXHandle alloc] initWithType:CXHandleTypePhoneNumber value:telnum];
CXStartCallAction *action = [[CXStartCallAction alloc] initWithCallUUID:callUUID handle:handle];
action.contactIdentifier = identifier;
action.destination = name;
[self.callController requestTransaction:[CXTransaction transactionWithActions:@[action]] completion:^(NSError * _Nullable error) {
NSLog(@"error %@",[error description]);
}];
return callUUID;
}
我需要知道如何为任何拨出电话更新远程处理程序,以便这将显示在远程电话列表中。
谢谢 :)