Block Call Using CallKit

352 views Asked by At

How i add Contact in Directory, i had add contact in CallDirectoryHander Class it's working fine, but when i want to add phone number dynamic from view Controller Page, then not block call .

I had try following code to Add contact in directory in view Controller

        let cnctNumber  =  phoneNumber.text
        let contentIs = CXCallDirectoryExtensionContext()

        //self.addBlockingPhoneNumbers(to: contentIs )
        numberContact = countryCode + self.phoneNumber.text!
        let numberFromString = Int64(numberContact)

        let phoneNumber : CXCallDirectoryPhoneNumber = CXCallDirectoryPhoneNumber(numberFromString!)

        contentIs.addBlockingEntry(withNextSequentialPhoneNumber: phoneNumber)

        contentIs.completeRequest()

        reloadDirectory()//To reload Directory
0

There are 0 answers