ios - CallKit:从被阻止的电话号码中接听电话
问题描述
我正在关注本教程https://www.raywenderlich.com/1276414-callkit-tutorial-for-ios,发现我在阻止列表中指定的电话号码可以拨打(除了那些在联系人中被阻止的号码)。`class CallDirectoryHandler: CXCallDirectoryProvider {
override func beginRequest(with context: CXCallDirectoryExtensionContext) {
context.delegate = self
context.addBlockingEntry(withNextSequentialPhoneNumber: 2222)
context.addIdentificationEntry(withNextSequentialPhoneNumber: 1111, label: "RW Tutorial Team")
context.addIdentificationEntry(withNextSequentialPhoneNumber: 353_1800_200_321, label: "Friendly Caller")
context.completeRequest()
}
和电话检索:
let update = CXCallUpdate()
update.remoteHandle = CXHandle(type: .phoneNumber, value: handle)
update.hasVideo = hasVideo
self.provider.reportNewIncomingCall(with: uuid, update: update) { error in
if error == nil {
let call = Call(uuid: uuid, handle: handle)
self.callManager.add(call: call)
}
completion?(error)
因此,对于 1111,我得到“RW 教程团队”标签,对于 353_1800_200_321,结果相同,但对于 2222,我收到来电。请帮忙。
解决方案
推荐阅读
- python-3.x - 进行回归时的gpflow矩阵反转错误
- javascript - 为什么它作为未定义的“发送”返回?
- mysql - Nodejs Mysql连接最佳实践
- sql - 有什么方法可以在 SQL Server 中使用 SIMILAR TO 运算符或任何其他运算符,如 Similar TO 运算符?
- java - 如何将libphonelib正确导入java项目?
- amazon-web-services - jest-haste-map: Haste 模块命名冲突 (AWS, RN)
- c# - AWS API Gateway Lambda 授权方请求类型没有 methodArn?
- ios - 分析显示在 AVSampleBufferDisplayLayer 中的帧颜色。图像缓冲区为零
- c++ - 删除操作员抛出“访问冲突读取位置”异常
- kotlin - 无法加载类“kotlin.coroutines.Continuation”