WatchKit Complications not syncing from iOS Watch app

I'm having an issue where the complications for my app aren't syncing to the watch if you add them from the Watch app on iOS.

However if you add them from the watch itself they work on the watch, but don't show on the iOS Watch app.

I'm using getLocalizableSampleTemplate(for:withHandler:) to generate the complication templates. I'm not including a complication bundle or static images since it appears that this is not needed anymore according to the docs.

The templates show fine on both the watch and iOS Watch app, they just don't show up on the watch if added from the iOS Watch app and vice versa. If I add a new watch face and then add the complications to it and try to set it as the default watch face from the iOS app it will set it on the watch, but doesn't have any of the complications.

If I load up the Console app and look at the iPhone system logs I can see it trying to send the watch face with the correct complication descriptors, but nothing happens on the watch itself. If I use a simulator it doesn't even sync any of the watch faces until I reboot the watch sim.

One final note, the watch portion of the app has not been released in the App store before. This is a new addition to an already released app. Not sure if that could be part of the issue, but just thought I should include it.

I'm at a loss here, any help would be appreciated.

Answered by drmidnight in 707036022

UserInfo in complications only supports Swift Strings for both the key and value. Seems like a bug to me, but this is the only way for them to actually work.

Looks like if userInfo is included in the CLKComplicationDescriptor they don't sync between the watch and iOS Watch App, however removing userInfo from my descriptors causes them to work as expected.

Is this a bug? What is the point of userInfo if you can't even use it.

EDIT: After some further investigation and testing it looks like the only thing that works in the userInfo dictionary is string types. Adding unsupported data types causes an exception stating it needs to be one of the base NS types (NSData, NSString, etc). However even with those types it fails. The only way I can get it to work is by using Swift strings for the key and value.

Accepted Answer

UserInfo in complications only supports Swift Strings for both the key and value. Seems like a bug to me, but this is the only way for them to actually work.

Hi! It sounds like you're doing things properly, so we'd like to investigate. Can you please file Feedback with a co-sysdiagnose (instructions at https://developer.apple.com/bug-reporting/profiles-and-logs/?platform=watchos) and post the FB number here? Thank you!

WatchKit Complications not syncing from iOS Watch app
 
 
Q