带有动态岛的iOS设备显示空的用户头像。如何禁用它?

问题描述 投票:0回答:1

我们的 iOS 应用程序中有 VoIP 功能,它使用 CallKit 来处理呼叫。在带有动态岛的新 iOS 设备中,我在来电中看到一个头像,里面什么也没有。 我想禁用此功能,但我不知道该怎么做。要么删除这个头像,要么填充它,但是空头像看起来不太好。

CXCallUpdate
有一个属性
_localizedCallerImageURL
但它是私有的。我没有看到任何其他方法来设置或删除这个头像。

    CXCallUpdate *update = [[CXCallUpdate alloc] init];
update.localizedCallerName = aCall.callerIdString;
update.localizedCallerImageURL = nil; // Not accessible 
[self.cxProvider reportNewIncomingCallWithUUID:aCall.cxUUID update:update completion:^(NSError *error) {
    if (error) {

enter image description here

ios swift objective-c callkit dynamic-island
1个回答
0
投票

正如我在我的案例中观察到的那样,当 remoteHandle 具有空字符串作为值时,就会出现空用户头像。因此,通过检查远程句柄值是否不是空字符串,可以避免此问题。

用户头像为空的情况(动态岛)

let handle = ""
let callUpdate = CXCallUpdate()
callUpdate.remoteHandle = CXHandle(type: .phoneNumber, value: handle)

修复方法只是检查 handle 是否为空字符串,如果是则为 nil,然后将其替换为任何关键字或数字,例如 Unknown。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.