iOS 10中的呼叫阻止功能

iOS 10中的呼叫阻止功能,第1张

概述我正在尝试集成CallDirectory Extension以阻止某些来电.但应用程序甚至无法识别为阻止提供的数字.是否有人成功地做到了这一点? 你可以看到我用过的格式.. private func addIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext) throws { let 我正在尝试集成CallDirectory Extension以阻止某些来电.但应用程序甚至无法识别为阻止提供的数字.是否有人成功地做到了这一点?
你可以看到我用过的格式..

private func addIDentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext) throws {            let phoneNumbers: [CXCallDirectoryPhoneNumber] = [ 18775555555,18885555555,+91949520]            let labels = [ "Telemarketer","Local business","myPhone"]            for (phoneNumber,label) in zip(phoneNumbers,labels) {                context.addIDentificationEntry(withNextSequentialPhoneNumber: phoneNumber,label: label)            }        }

而且,我将此称为开发. http://iphoneramble.blogspot.in/2016/07/ios-10-callkit-directory-extension.html

测试装置& iOS版本 – iphone 5s,iOS 10.1

解决方法 到目前为止,我已经得到了呼叫阻止的解决方案.我还没有办法检查呼叫阻止代码是否正常工作.以下是我为使其工作所做的一些事情.

>检查您的应用程序是否在64位iOS设备上运行
(iphone 5s或更高版本的设备)
>以数字递增顺序添加数字
>为每个号码添加国家/地区代码
>下面给出了用于添加用于阻止的移动号码的示例代码

let phoneNumber : CXCallDirectoryPhoneNumber =
CXCallDirectoryPhoneNumber(“+9194******”)!
context.addBlockingEntry(withNextSequentialPhoneNumber: phoneNumber)

>检查您的申请是否已获得黑色电话的许可
(设置 – >电话 – >呼叫阻止和识别 – >检查您的应用是否允许阻止呼叫)
>您还可以通过将以下代码放在vIEwController中来检查enabledStatus

CXCallDirectoryManager.sharedInstance.getEnabledStatusForExtension(withIDentifIEr:
“bundleIDentifIErOfYourExtension”,completionHandler:
{(status,error) -> VoID in
if let error = error {
print(error.localizedDescription)
}
})

>另外,将以下代码添加到vIEwController

CXCallDirectoryManager.sharedInstance.reloadExtension(withIDentifIEr:
“bundleIDentifIErOfYourExtension”,completionHandler: { (error) -> VoID in
if let error = error {
print(error.localizedDescription)
}
})

您会发现这些网址对开发很有帮助.
 http://iphoneramble.blogspot.in/2016/07/ios-10-callkit-directory-extension.html

https://translate.google.com/translate?hl=en&sl=zh-CN&u=http://colin1994.github.io/2016/06/17/Call-Directory-Extension-Study/&prev=search

如果您有改进的方法和更正,请告诉我.谢谢和快乐的编码.

总结

以上是内存溢出为你收集整理的iOS 10中的呼叫阻止功能全部内容,希望文章能够帮你解决iOS 10中的呼叫阻止功能所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1073005.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存