Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Force companion to pass info

ANSWERED

Hello,

I have to get my local time zone from my companion device (Fitbit still does not include this info in its Date function).  The only time I can get the time zone is if there is a settings change.  Is there a way to store the last sent time zone, check it against the current one, then send it the tracker if there is a change?

 

  

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

The device can ask the companion what the timezone is using the Messaging API. You can persist that in the companion using local-storage.

 

https://dev.fitbit.com/build/guides/communications/messaging/

 

https://dev.fitbit.com/build/reference/companion-api/local-storage/

View best answer in original post

Best Answer
0 Votes
4 REPLIES 4

The device can ask the companion what the timezone is using the Messaging API. You can persist that in the companion using local-storage.

 

https://dev.fitbit.com/build/guides/communications/messaging/

 

https://dev.fitbit.com/build/reference/companion-api/local-storage/

Best Answer
0 Votes

Thanks for letting me know it can be done.  Now the fun part...

Best Answer
0 Votes

Any tips on how to get the companion app to activate without opening it?  It doesn't seem that having this code helps if I have no way to get it to execute.  Other than opening the companion app, is there a way to make it run?  The only solution I can come up with is to sync on a too frequent basis.

 

Thanks.

Best Answer
0 Votes

Just send a message from the device to the companion and the companion will wake if it's sleeping.

Best Answer
0 Votes