We have a watchOS app that provides many configurable widgets. Those widgets are configured and installed with help of AppIntent:
public struct RectComplAppIntent: AppIntent, WidgetConfigurationIntent, CustomIntentMigratedAppIntent {
@Parameter(title: "Style")
var style: String?
....
}
However when I print WidgetInfos with getCurrentConfigurations()
, I sometimes got nil
for configuration
. At the same time widgets are not loaded. Exact steps:
- User installs the pre-cofnigured .watchface.
- Complications are not loaded since configuration is missing. I print
getCurrentConfigurations()
and get entries like this:
WidgetInfo:
- configuration: nil
- widgetConfigurationIntent: nil
- family: accessoryRectangular
- kind: Rectangle
- Then user force-touches a face and opens editing mode. Returns to watch app, prints infos:
WidgetInfo:
- configuration: <INIntent: 0x780d290> {
style = vol1Logo;
}
- widgetConfigurationIntent: nil
- family: accessoryRectangular
- kind: Rectangle
– Suddenly intent appears with the correct style and complications start to show up.
How do you think, why it happens? Why after .watchface install all the WidgetInfo
has nil
intent (configuration)? What helps them to load later?
You can try this face yourself: https://cdn.watchfaces.co/watchfaces/glance-minimalist.watchface