本文介绍了CallKit-最近通话中的通话记录不显示拨出电话的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VOIP应用程序中使用CallKit.拨打电话后,除了最近通话清单中的所有内容外,其他所有功能都正常,即使该号码已保存在电话簿中,它也仅显示该号码.例如,电话簿中有一个名为约翰"的联系人.现在,如果从应用程序发出去电,则在最近的日志中,它仅显示该号码.这就是我所做的.

I am using CallKit in a VOIP application. Everything works fine except in the recent call list after an outgoing call is placed, it shows only the number, even though the number is saved in the phonebook.for example, there is a contact named 'John' in the phonebook. now if an outgoing call is placed from the app, in the recent log it only shows the number. this is what i did.

NSUUID *callUUID = [NSUUID UUID];
CXHandle *handle = [[CXHandle alloc] initWithType:CXHandleTypePhoneNumber value:number];
CXStartCallAction *action = [[CXStartCallAction alloc] initWithCallUUID:callUUID handle:handle];
action.contactIdentifier = identifier; //identifier of that contact
[self.callController requestTransaction:[CXTransaction transactionWithActions:@[action]] completion:completion];

推荐答案

问题是您在打出电话时不告诉提供商名称,可以在 performStartCallAction 中添加名称来解决下一个代码:

The problem is that you don't tell the provider the name when start a outgoing call, you can solve it adding in performStartCallAction the next code:

CXCallUpdate *update = [[CXCallUpdate alloc] init];
[update setRemoteHandle:[[CXHandle alloc] initWithType:CXHandleTypePhoneNumber value:number]];
[update setLocalizedCallerName:name];

[provider reportCallWithUUID:uuid updated:update];

使用此代码,我解决了相同的问题,现在它显示了名称.

With this code I solved the same problem and now it show the name.

这篇关于CallKit-最近通话中的通话记录不显示拨出电话的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 19:46