How to reset intent extension configurations in WidgetKit How to reset intent extension configurations in WidgetKit swift swift

How to reset intent extension configurations in WidgetKit


You cant. the only option you have is to ignore the configuration option on the widget side and show some kind of error message to the user that their config needs to be updated. INExtension does not provide a way to handle this (yet)


I had the same issue that the widget was showing stale configuration options. I solved this by forcefully refreshing all objects in my shared Core Data database which I was using. I did this in the „getTimeline“ method.


I found this solution, but for dynamic properties only: use different identifiers for every user in your IntentHandler.Example:

class IntentHandler: XXExtension { ... }extension IntentHandler: XXDynamicXXXSelectionIntentHandling {   func provideXXXOptionsCollection(for intent: XXDynamicXXXSelectionIntent, with completion: @escaping (XXObjectCollection<XXX>?, Error?) -> Void) {      let userId = (UserDefaults.myGroup().object(forKey: "UserId" ) as? String) ?? ""      let items: [XXX] = UserDefaults.myGroup().sharedXxx.map { (sharedXxx) -> XXX in         return XXX(identifier: userId + "_" + sharedXxx.Id // <== add unique prefix ===                       display: sharedXxx.visibleName())      }              let collection = XXObjectCollection(items: items)      completion(collection, nil)   }}