Sample of CIQ Complication Publisher and Consumer of those Complications

Here are two apps. 

The first publishes Complications in a CIQ app.  There is a background services and it publishes a string with the time as "HH:MM" every 5 minutes.  It publishes 3, with one being public, one being protected, and one being private.

0675.CompPub.zip

The second app is a watch face that consumes the above complications.

CompCon.zip

Both apps have a 945 as a target (it doesn't have complications) and a 955 and 965 which do.

  • I've followed this example and can't get it to work.

    I have two apps - a widget that receives phone app messages (containing live wind and tide data) and then updates the data on storage of the widget app, shows the new values on the widget screen, and publishes the data to a complication. I also have a watch face app which is a subscriber to those complications. 

    When debugging the widget app, I'm seeing it updating the complications when receiving new data from the phone app messages, and when debugging the watch face app in the simulator, I see it finds the complications defined in the widget app and registers for the complication change callback, but as far as I know, there's no way in testing the complication updates between the widget and watch face in the simulator.

    On my watch, my widget is getting it's data updated from the phone app, but the watch face is not getting that data published to it and I have no idea at what point the complications are going wrong. Any ideas how to debug this?

    Many Thanks!

  • To me it sounds like the widget is only running when the user is on the glance or on the widget. This would explain why you don't see any updates in the watch-face, because when you're looking at the watch face then you're not looking at the widget.

    However there's an easy way you could confirm this: in the widget add a log with a timestamp and the value you publish, and also to onStart, onStop, then side-load it to the watch and add the necessary TXT file to the Garmin/Apps/Log folder, then open the widget, then go back to the watch face, and take note of the time and wait for a while. Later looking at the logs you should be able to verify if I am correct or not.

  • Thanks for the fast reply, and also for your patience, this is my first attempt at a Garmin app. I've not managed to side load an app as my watch doesn't show up in devices on my mac when plugged in and haven't got it to side load via garmin express either. 

    I've been assuming that because the data on my widget has been updated by the phone app messages even though the widget was not running (or open), that the complications would also have been updated, because it's happening in the same code. So I figured that if it doesn't require the widget to be open for the widget to receive the phone app messages and update it's data, then it wouldn't require it to be open to publish the complication updates.

    Also, even if I have the widget open and send it the phone app message, the data changes and it still doesn't get sent to the watch face.

  • In the sim, start the publisher app and let it run.  You'll see the time that the background service runs (every 5 minutes).

    Then, press the back button to close the publisher.

    Without restarting the sim, run the consumer for the same device.  You'll see a watch face where the data that's published it shown.  Let it run for maybe 10 minutes and you'll see the times update every 5 minutes. (the yellow data)

    Having a background service is important for the publisher.

  • I'll give it a go with the background process, although I don't really understand why it doesn't work with the widget open. Thanks for your help!

  • When you "widget" is running, your watchface isn't.  With a background service, the "widget" will continue to publish while your watchface is running, so the watchface shows the newest data published,