1

私は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;
}

これがリモート通話リストに表示されるように、発信通話のリモートハンドラーを更新する方法を知る必要があります。

ありがとうございました :)

4

2 に答える 2

0

reportOutgoingCall が機能するためには、CXStartCallAction を作成し、このアクションで CXTransaction を要求する必要があります。

于 2017-01-05T10:46:52.380 に答える