[ad_1]
I’m working with CallKit about module Identification
Step 1: I entered the right cellphone quantity with the nation code -> identification works wonderful
Step 2: I add extra random numbers + add nation code -> After all the numbers I random usually are not actual -> Identification not working with the numbers random and the numbers I added the primary time in step 1
My code:
non-public func addAllIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext) {
// Retrieve cellphone numbers to establish and their identification labels from knowledge retailer. For optimum efficiency and reminiscence utilization when there are lots of cellphone numbers,
// think about solely loading a subset of numbers at a given time and utilizing autorelease pool(s) to launch objects allotted throughout every batch of numbers that are loaded.
//
// Numbers have to be supplied in numerically ascending order.
if let identifications = strive? self.fetchSpamSync() {
for identification in identifications {
if let title = identification.title {
var quantity = String(identification.quantity)
quantity = "084" + quantity
let newNumber = Int64(quantity as String) ?? Int64("0")!
if newNumber != 0 {
context.addIdentificationEntry(withNextSequentialPhoneNumber: newNumber, label: title)
}
}
}
}}
non-public func addOrRemoveIncrementalIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext, since date: Date) {
// Retrieve any adjustments to the set of cellphone numbers to establish (and their identification labels) from knowledge retailer. For optimum efficiency and reminiscence utilization when there are lots of cellphone numbers,
// think about solely loading a subset of numbers at a given time and utilizing autorelease pool(s) to launch objects allotted throughout every batch of numbers that are loaded.
if let identifications = strive? self.fetchSpamSync(includeRemoved: true, since: date) {
for identification in identifications {
if identification.isRemoved {
context.removeIdentificationEntry(withPhoneNumber: identification.quantity)
} else {
if let title = identification.title {
var quantity = String(identification.quantity)
quantity = "084" + quantity
let newNumber = Int64(quantity as String) ?? Int64("0")!
if newNumber != 0 {
context.addIdentificationEntry(withNextSequentialPhoneNumber: newNumber, label: title)
}
}
}
}
}} // Report the most-recently loaded set of identification entries in knowledge retailer for the subsequent incremental load...
Are you able to inform me what’s inflicting the error with all of the numbers I simply added though some have labored wonderful and proper
Is it potential that if one in every of them fails, all of them will not work?
though it labored wonderful earlier than
Many thanks !
[ad_2]
