im implementing callKit in my iOS project, im using the callDirectory extension to block and identify Numbers, the block part works perfectly , the only problem is when i try to add numbers to be identified:
private func retrievePhoneNumbersToIdentifyAndLabels() -> (phoneNumbers: [String], labels: [String])? {
// retrieve list of phone numbers to identify, and their labels
interDefaults?.synchronize()
if let numbers = interDefaults!.string(forKey: "ident-numbers"){
if let identities = interDefaults!.string(forKey: "ident-identities"){
let formattedNumbers = numbers.characters.split{$0 == "*"}.map(String.init)
let formattedIdent = identities.characters.split{$0 == "*"}.map(String.init)
return (formattedNumbers, formattedIdent)
}
}
return ([""], [""])
}
When i try to relaod the extension it fails with error : Error Domain=com.apple.CallKit.error.calldirectorymanager Code=3 "(null)"
with some testing i figured out that by replacing the formattedIdent
with an array of 1 element EXP: ["Spamm Caller"]
the extension works perfectly and shows no error but when i use an array with more than one element the same error shows up.
im i doing something wrong ?? thanks in advance