CallKit - Call log in recent calls does not show name for outgoing call

心不动则不痛 提交于 2019-12-30 05:28:14

问题


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];

回答1:


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.



来源:https://stackoverflow.com/questions/41545389/callkit-call-log-in-recent-calls-does-not-show-name-for-outgoing-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!