07-02-2018 16:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-02-2018 16:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hello,
I've got a clockface that I'm developing that uses the companion to connect to some web services, collate data from the various services into a json formatted file to be sent to the fitbit Versa for display. Works great except when I initialize the clockface after I run it from dev studio. The clockface displays but none of the companion data displays until I get out of the clockface and then back in... say if I go to the "today" screen, and then back into the clockface, then it communicates with companion and all the data appears from then on out.
How can I make it so the clockface communicates with the companion right off the bat without me having to go out by closing it and then back in?
Thanks.
Answered! Go to the Best Answer.

Accepted Solutions
07-05-2018 22:56 - edited 07-05-2018 23:02
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-05-2018 22:56 - edited 07-05-2018 23:02
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I am assuming that your code includes a function to read and display all the data. You could call this function when you receive the file on the device, unless I am missing something.

07-04-2018 22:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-04-2018 22:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Just stumbling in the dark here but it sounds like the data is retrieved, formatted and sent to the device AFTER it finishes displaying. Pepper your code with some
console.log( "checkpoint ..." );
in order to test this hypothesis and understand what really happens during the first run.

07-05-2018 15:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-05-2018 15:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Correct. Upon first install/run after building in the dev studio, the clockface displays prior to initially fetching any data from the companion. So, certain elements like the time, heart, steps, etc... display but the data, such as weather, from the companion don't display. I use the file transfer process for interacting with the companion. The thing is, that file interaction doesn't automatically take place when I build and run the clockface. I have to wait for it to install and display... with many of the data elements on the display remaining blank... then I have to either go to some other app or the "today" screen or settings, then back to the clockface... then the clockface will open the file, read the data and display the data on the clockface. From then on out, it works properly and fetches data from the file created on the companion properly.. until I build and install another version from dev studio.

07-05-2018 22:56 - edited 07-05-2018 23:02
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-05-2018 22:56 - edited 07-05-2018 23:02
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I am assuming that your code includes a function to read and display all the data. You could call this function when you receive the file on the device, unless I am missing something.

07-06-2018 10:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-06-2018 10:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Oh man, big time goof on my part. I didn't put that function in my init area... thought I had. Added it and now runs fully with no issues start to finish.
