- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已成功安装扩展CXCallDirectoryProvider,以识别预先添加的电话条目。我在网上找到的文档相当不够。尽管如此,我还是成功地完成了必要的电话条目的初始导入。通过重写 func beginRequest(with context: CXCallDirectoryExtensionContext)。更具体:
override func beginRequest(with context: CXCallDirectoryExtensionContext) {
context.delegate = self
// Check whether this is an "incremental" data request. If so, only provide the set of phone number blocking
// and identification entries which have been added or removed since the last time this extension's data was loaded.
// But the extension must still be prepared to provide the full set of data at any time, so add all blocking
// and identification phone numbers if the request is not incremental.
if #available(iOS 11, *) {
if context.isIncremental {
addOrRemoveIncrementalBlockingPhoneNumbers(to: context)
addOrRemoveIncrementalIdentificationPhoneNumbers(to: context)
} else {
addAllBlockingPhoneNumbers(to: context)
addAllIdentificationPhoneNumbers(to: context)
}
} else {
addAllBlockingPhoneNumbers(to: context)
addAllIdentificationPhoneNumbers(to: context)
}
context.completeRequest()
}
上面最初安装电话记录的调用函数是addAllIdentificationPhoneNumbers并且工作起来就像一个魅力。
private func addAllIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext) {
// Retrieve phone numbers to identify and their identification labels from data store. For optimal performance and memory usage when there are many phone numbers,
// consider only loading a subset of numbers at a given time and using autorelease pool(s) to release objects allocated during each batch of numbers which are loaded.
//
// Numbers must be provided in numerically ascending order.
var allNumbers = [(Number: String, Fullname: String)]()
// load allNumbers from local db
// ...
// ...
// ...
var test = allNumbers.map { s -> (Number: CXCallDirectoryPhoneNumber, Fullname:String) in
(CXCallDirectoryPhoneNumber(s.Number)!, s.Fullname)
}
// inc order
test.sort(by: { $0.Number < $1.Number })
// do the mapping to satisfy CallKit
let allPhoneNumbers = test.map { $0.Number }
let labels = test.map { $0.Fullname }
for (phoneNumber, label) in zip(allPhoneNumbers, labels) {
context.addIdentificationEntry(withNextSequentialPhoneNumber: phoneNumber, label: label)
}
}
当用户到达“设置”->“电话”->“调用阻止和识别”并启用应用程序名称旁边的句柄时,将运行上述代码。
现在问题部分...
此代码如何阻止
if context.isIncremental {
addOrRemoveIncrementalBlockingPhoneNumbers(to: context)
addOrRemoveIncrementalIdentificationPhoneNumbers(to: context)
}
为了更新经常更改的记录而触发?
是否有任何指南/模式或几乎任何东西可以为我指明正确的方向,即如何维护这些条目并在它们更改时保持它们最新,或者添加新的,甚至删除过时的条目。我在网上找不到任何有关初始 addAllIdentificationPhoneNumbers 增量的信息。
最佳答案
只有在您的扩展程序运行一次并提供其初始的完整基准数据集后,才会请求增量数据集。
例如,如果您的扩展程序在安装后运行一次,提供其基准数据集,然后您的应用程序调用 CXCallDirectoryManager.reloadExtension(identifier:completion:)
要请求重新运行扩展,后续重新运行应该是增量的。
关于iOS CallKit 调用识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49239456/
我想开发一个 SOS 应用程序。当我尝试使用 URL 模式 openURL() 时,它会显示一个警报,但我的要求是在尝试调用时连接调用而没有任何警报或弹出窗口。所以我找到了一个使用 CallKit 的
我正在使用 callkit 来识别电话号码。 它给我错误:操作无法完成。 (com.apple.CallKit.error.calldirectorymanager 错误 1.) override
我正在使用 Twilio 语音快速入门代码 https://github.com/twilio/voice-quickstart-swift .当我进行客户端对客户端调用时,调用无法接通。虽然 Cal
我已经尝试了很多使用 CallKit 在 ios swift 上启动传出调用的示例。我在功能中启用了 VOIP。在所有情况下,它都会失败: callController.request(transac
我的 iOS VoIP 应用程序使用 CallKit 来支持 native 调用集成功能。第一次启动时一切正常,但如果我重新初始化 CXProvider 和 CXCallController(为了禁用
我制作了 VOIP 应用程序。为此,我将 PushKit 和 Callkit 与 pjsip 结合使用。 当后台应用程序收到调用通知时,我打开 Callkit 屏幕,然后单击接受调用后使用 pjsip
此错误仅出现在 iOS 13.3.1 中。它不会出现在 iOS 13.3.0 或更早版本上。 如果应用程序在前台并调用 CXCallController.request,则它工作正常。但是一旦我将应用
我开发了一个 VoIP 应用程序。我现在正在与 callkit 框架集成。一切都很好,除了 session 。 情况如下: 1.) 我打电话。 2.) 保留第一个调用并调用另一个。 3.) 我点击 s
我在 VOIP 应用程序中使用 CallKit。一切正常,除了在拨出电话后的最近通话列表中,它只显示号码,即使号码保存在电话簿中。 例如,电话簿中有一个名为“John”的联系人。现在,如果从应用程序拨
假设一个应用程序一次支持两个调用。第一个电话已接通,第二个电话打进来。一个得到“结束通话和接听电话”、“拒绝”、“保持通话和接听电话”按钮。 如果是“挂断接听电话”,则表示结束已接通的通话并接听新来电
我正在开发 CallKit 应用程序,我遇到一个问题,在 CallKit 屏幕上“交换”调用时,调用保持无法重新启动音频,直到用户返回到应用内调用屏幕。我可以通过更新来绕过这个: supportsHo
我已经使用 pjsip 库开发了 ios voip 应用程序。在这个应用程序传入 View 中,我在这里使用带有 pushkit 的 callkit 音频和麦克风在 ios 10.2 版本中不起作用
我使用 CallKit 开发了一个 VoIP 应用。 如果用户收到两个来电并且他/她接听其中一个,另一个将关闭。 例如报告两个来电: reportInComingCall uuid: 70D506FB
我已成功安装扩展CXCallDirectoryProvider,以识别预先添加的电话条目。我在网上找到的文档相当不够。尽管如此,我还是成功地完成了必要的电话条目的初始导入。通过重写 func begi
是否可以使用 CallKit 获取所有 CallKit 扩展程序中已阻止的所有电话号码的列表? 最佳答案 不,这是不可能的。 CallKit 扩展只能将号码添加到列表中。没有用于检索被阻止号码的 AP
CallKit作为iOS10的新特性,功能强大。屏幕锁定时,如何禁用“视频”按钮?喜欢图片底部: example 最佳答案 您必须将 CXProviderConfiguration 中的 suppor
我正在使用调用套件框架进行调用,请帮助我 如何在应用程序在前台和调用过程中发生来电时删除调用套件 ui,我在后台获取调用套件 ui。 最佳答案 您可以在向 CXProvider 报告新来电之前检查应用
我正在尝试在 Swift 中使用 CallKit 来识别调用者。 我正在寻找一种通过发出 URL 请求来识别调用者的方法。 例如:+1-234-45-241 给我打电话,我希望它向 mydomain.
我现在正在玩 CallKit。我已经下载了 SpeakerBox 示例,我有自己的示例,它使用 SpeakerBox 中的自定义 SIP 和 WebRTC 以及 CallKit 代码。 我注意到在 S
我正在尝试在我的 VoIP 应用程序中实现 Apple CallKit。我正在使用 Xcode 9.2、Swift 4.0.3、iOS 10.3。问题是我不知道该怎么做。我试图在网络上搜索教程,但我没
我是一名优秀的程序员,十分优秀!