ios – Identification CallKit not working for unknown purpose


I’m working with CallKit about module Identification

Step 1: I entered the proper telephone quantity with the nation code -> identification works wonderful

Step 2: I add extra random numbers + add nation code -> After all the numbers I random aren’t actual -> Identification not working with the numbers random and the numbers I added the primary time in step 1

My code:

personal func addAllIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext) {
// Retrieve telephone numbers to determine and their identification labels from knowledge retailer. For optimum efficiency and reminiscence utilization when there are lots of telephone numbers,
// take into account 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 offered in numerically ascending order.
if let identifications = attempt? 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)
      }
    }
  }
}}

personal func addOrRemoveIncrementalIdentificationPhoneNumbers(to context: CXCallDirectoryExtensionContext, since date: Date) {
// Retrieve any adjustments to the set of telephone numbers to determine (and their identification labels) from knowledge retailer. For optimum efficiency and reminiscence utilization when there are lots of telephone numbers,
// take into account 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 = attempt? 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)
        }
      }
    }
  }
}}    // File 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 doable that if certainly one of them fails, all of them will not work?
though it labored wonderful earlier than

Many thanks !

Leave a Reply