I've added Widget Extension with Configuration Intent. For the logging purposes, I've tried to log number of widgets user of the app has
WidgetCenter.shared.getCurrentConfigurations { results in
guard let widgets = try? results.get() else { return }
..<log widgets.count>...
}
To my surprise, instead of the active [WidgetInfo]'s I've got a whole list of all the configuration intents ever been used in all the widgets instead of the actual ones.
I.e. I have 2 widgets on the screen, while WidgetCenter
claims I have 9 current configurations. Any better ideas how to count widgets?
iOS 14 Beta 8 (both iPhone & Simulator) & Xcode 12 Beta 6
Apparently iOS caches the configuration of all widgets ever created for an app, and recreates the configurations cache on startup of iOS.
So if you really want function getCurrentConfigurations
to return the current configurations, restart your device first.
It seems to be an Beta-issue, that has been resolved with GA-release. Need to observe more, but with today's Xcode build I'm seeing relevant numbers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With