Hi,
I followed excactly the steps in https://developer.apple.com/videos/play/wwdc2022/10050 to add Widgetkit for watchOS to my existing iOS Widgets.
Both widgets do work for iOS, but on my Apple Watch, my widget is invisible to be set as a complication.
Any idea what I'm doing wrong?
...
@available(iOSApplicationExtension 16.0, *)
struct MyWidget: Widget {
private let kind: String = "MyWidget"
var body: some WidgetConfiguration {
return IntentConfiguration(kind: kind, intent: WidgetConfigurationIntent.self, provider: Provider()) { entry in
MyWidgetComponent(entry: entry)
}
.configurationDisplayName("widget_name_description".localized())
.description("widget_name_description".localized())
.supportedFamilies([.accessoryCircular, .accessoryRectangular, .accessoryInline])
}
}
@main
struct MyAppWidgets: WidgetBundle {
#if os(watchOS)
var body: some Widget {
return MyWidget()
}
#else
var body: some Widget {
if #available(iOS 16.0, *) {
return WidgetBundleBuilder.buildBlock(OtherIosWidget(), MyWidget())
} else {
return OtherIosWidget()
}
}
#endif
}
...