Hi, I'm migrating ClockKit complications to WidgetKit. Everything works well except when I run the WidgetKit version, I see complications appear twice each in the complications list for my app when adding them.
If I restart the app from Xcode, it won't happen again, only for the first time. But on the actual device, only Watch restart or app reinstall fixes it which is frustrating and would not be ideal for live users.
I even tried Apple's example ClockKit project -> added complications to watch face -> added WidgetKit target, CLKComplicationWidgetMigrator
and func widgetConfiguration(from complicationDescriptor: CLKComplicationDescriptor)
code -> run the app -> new complications appear correctly replacing old ones -> when hold to add/change complications I see it doubled (screenshot attached) and it's even selected twice
If I add more complications, they will appear two times as well except one selected in two places almost like it's two same lists created.
class ComplicationController: NSObject, CLKComplicationDataSource, CLKComplicationWidgetMigrator {
@available(watchOSApplicationExtension 9.0, *)
var widgetMigrator: CLKComplicationWidgetMigrator {
self
}
@available(watchOSApplicationExtension 9.0, *)
func widgetConfiguration(from complicationDescriptor: CLKComplicationDescriptor) async -> CLKComplicationWidgetMigrationConfiguration? {
switch complicationDescriptor.identifier {
case "Coffee_Tracker_Caffeine_Dose":
return CLKComplicationStaticWidgetMigrationConfiguration(
kind: "WidgetKitComplications",
extensionBundleIdentifier: "com.example.apple-samplecode.Coffee-Tracker.watchkitapp.watchkitextension.WidgetKitComplications")
default:
return nil
}
}
Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. I'd greatly appreciate it if you could open a bug report, include sample project and sysdiagnose, and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.
Rico
WWDR - DTS - Software Engineer