CallDirectoryExtension has an error during user use [loading indefinitely]

75 views Asked by At

I'm using the Call Identification utility to identify incoming calls, but during use, some of my users have encountered an error as shown below.

enter image description here

Is there any solution for this situation? Can I refresh the extension to its original state so users can continue to use it?

My code:

override func beginRequest(with context: CXCallDirectoryExtensionContext) {
context.delegate = self
let defaults = UserDefaults.standard
// Check whether this is an "incremental" data request. If so, only provide the set of phone number blocking
// and identification entries which have been added or removed since the last time this extension's data was loaded.
// But the extension must still be prepared to provide the full set of data at any time, so add all blocking
// and identification phone numbers if the request is not incremental.

if let lastIndentifyUpdate = defaults.object(forKey: "lastIndentifyUpdate") as? Date, context.isIncremental {
  addOrRemoveIncrementalIdentificationPhoneNumbers(to: context, since: lastIndentifyUpdate)
} else {
  addAllIdentificationPhoneNumbers(to: context)
}

defaults.set(Date(), forKey:"lastIndentifyUpdate")

context.completeRequest()
}

// Record the most-recently loaded set of identification entries in data store for the next incremental load...
}

Thanks a lot

0

There are 0 answers