Call blocking feature in iOS 10

I am trying to integrate the CallDirectory extension to block an incoming call. But the application does not even recognize the numbers provided for blocking. Is there anyone who has succeeded in this? You can see the format that I used.

   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)
            }
        }

And I called it for development. http://iphoneramble.blogspot.in/2016/07/ios-10-callkit-directory-extension.html

Testing device and version of iOS - iphone 5s, iOS 10.1

+4
source share
2 answers

Atlast, . , . , .

  • , 64- iOS ( iphone 5 )
  • allow phoneNumber: CXCallDirectoryPhoneNumber = CXCallDirectoryPhoneNumber ( "+ 9194 ******" )!             context.addBlockingEntry(withNextSequentialPhoneNumber: )

  • , ( → → → , )

  • enabledStatus, viewController

CXCallDirectoryManager.sharedInstance.getEnabledStatusForExtension(withIdentifier: "bundleIdentifierOfYourExtension", completeHandler: {(, ) →          = {              (error.localizedDescription)         }     })

  • Controller

CXCallDirectoryManager.sharedInstance.reloadExtension(withIdentifier: "bundleIdentifierOfYourExtension", completeHandler: {(error) →                  = {                       (error.localizedDescription)                 }             })

URL- .  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.imtqy.com/2016/06/17/Call-Directory-Extension-Study/&prev=search

, , . .

+3

int64. . " ".

+1

Source: https://habr.com/ru/post/1661170/


All Articles