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

Companion - Need Device API info on Wakeup

Hi all,

I have an application which has the companion component set to wake up every few hours. The application, when it is launched, sends a few pieces of data to the companion, and the companion then stores this using Local-Storage.

 

One piece of data I'm storing is the current calories burned, a property accessible in the Device API using `today.local.calories` . 

 

The issue is, when the companion wakes up, I need the most current value from the Device API `today.local.calories` , instead of the last one to be sent by the application. I can't seem to figure out how to get either:

1. The companion to wake up the application, and trigger the application to fetch the data to send back to the companion.

or

2. Have the companion access that piece of data by itself, either using the Device API or some other method? 

Not sure if what I want to do is possible. 

Thanks

Best Answer
0 Votes
1 REPLY 1

Your app can't send data to the companion if it isn't running, and likewise the companion can't get data from the device if your app isn't running.

 

The only other way to do it is via the Web API. https://dev.fitbit.com/build/reference/web-api/activity/#get-daily-activity-summary

Best Answer
0 Votes