Are complications only received when the WatchFace derived View is active?

Looking to where I should put my Complications specific functions in my watch face. From logging statements put in the watch face code, I see that no complication is ever received when the watch is showing a glance/widget or an activity app. Are there situations where complications could be received by the watch face when the WatchFace View isn't showing? If no, then are there reason for NOT putting the complication in the WatchFace derived class instead of the appBase derived class. I'm trying to save space from the background space.

  • In a watch face I do all all my complication related stuff in the View, not in AppBase. That's where I subscribe, and have the callback for the wf to see if something has changed.

  • That's what I do too but since the callback seems to happen only when the view is active, what's the point of having it in the AppBase class and wasting background space?

  • It's in my views, not appbase.  If you don't have a background services in the WF, (the WF's I'm building dont), no problem with having the stuff in AppBase.

  • Oh, I misread then. I thought you meant you have the complication stuff (doing the  "massaging" of the data received) in the View but the callback in the AppBase itself.

    I had everything in the View class at first, then I noticed the example had them in the AppBase class and I also noticed that no complications were received while the watch face wasn't active. Thinking the reason was because I had them in the View Class, I moved everything to the AppBase class. Still no Complications received while the View Class isn't up, hence this post. Sigh, Ok, I'll move everything back to the View Class then to free some much needed space from 32KB of background space.

  • If you leave the watch faces (go to glances for example), when you return to the watch face, you should see the latest value.  I do, for sure.

    When you are doing the subscribe for updats, are you also getting the value at the same time?  I do.  While the watchface is running, I only subscribe once and after that I also get the value in the callback I've registered.

  • Garmin Complications are sent every second while the View Class is active from what I can see, so even if not sent while and App or Glance is active, it has very little impact. Although I do see at the exact second of registering for a complication a call to the callback. But, onTemporalEvent Complications sent from the background class of a widget is a completely different story as can be seen below. I went for a bike ride yesterday late afternoon and it shows that no 'gratious' Complication is sent when the View class is built, so what you have before the view closed down is what you'll have once it shows up again, assuming you stored it somewhere.

    16:53:57 : Complication read: 200|58|Charging|35|false|false|online
    16:58:58 : Complication read: 200|60|Charging|36|false|false|online
    17:04:00 : Complication read: 200|61|Charging|36|false|false|online
    17:04:24 : View hidding
    18:09:09 : View showing
    18:13:56 : Complication read: 408|65|Complete|36|false|false|asleep
    18:18:59 : Complication read: 408|65|Complete|36|false|false|asleep
    18:23:54 : Complication read: -104|65|Complete|36|false|false|asleep

    And on the widget side, it kept sending its Complications:

    17:43:58 : Sending Complication: 408|65|Complete|36|false|false|asleep
    17:48:57 : Sending Complication: 408|65|Complete|36|false|false|asleep
    17:53:58 : Sending Complication: 408|65|Complete|36|false|false|asleep

    BTW, the weird formatted complication is because I have control of the sending (widget) and receiving end (watch face). In the widget settings, there is a checkbox to specify if "enhanced data" is to be sent or simply the battery state of charge (for any other watch face the user might be using). This is showing the "Enhanced data", which is a 'CSV' string separated by '|'.

  • In my widgets that publish, I publish from the background every 15 minutes by default, and see them right away in the watch face if it's being viewed.  If I'm not viewing the watch face, I see the new value as soon as I return to it.  My published data includes a time stamp so it's easy to see when there is new data.

  • Hmm, interesting. So you're saying that as soon as you call Complications.subscribeToUpdates, you receive the latest Complication data? I'm definitely not seeing that. I don't see anything until the next temporal event time is reached.

    Is there a way in the Simulator to simulate a watch face losing focus as if an app or widget took over and then come back to the watch face? "Force onHide" doesn't do the same as losing focus to an app or widget.

  • Like I said, when I subscribe, I also get the value of the complicaton.  In the sim,run your widget, exit it, run your WF and you should see what was last published.  Then close the watch face app, but leave the sim running.  Run the watchface later and you'll see what was last published by your widget.  That's how I've been testing publishing all along.

  • By "close the watch face app", you mean "Kill App" from the File menu? That's the least drastic way of closing a watch face that I can see.