I am working on callKit framework, I found that by the use of call directory extension, we can Identify the incoming phone number. My question how to implement a call direct
Firstly you need to enable your CallBlocker app in App Setting for that follow this -
Go to Settings->Phone->Call blocking & identification->Enable your App.
After that use addIdentificationEntry
for adding entry
private func addIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext) throws {
let phoneNumbers: [CXCallDirectoryPhoneNumber] = [ 18775555555, +919899999999 ]
let labels = [ "Telemarketer", "Local business" ]
for (phoneNumber, label) in zip(phoneNumbers, labels) {
context.addIdentificationEntry(withNextSequentialPhoneNumber: phoneNumber, label: label)
}
}
Which is working fine in Xcode 8.x swift 3.x