12-04-2017 07:13
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-04-2017 07:13
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
My app calculates a bunch of data based on the GPS.
Note, the app is NOT used next to the companion, as the phone is left behind. I can write a file on the device with all the data. Once activity is finished, app is closed. It could connect to the companion later, possibly.
How do I get the file into the companion and out to me afterwards?
Using the WebAPI is too reductive, as the fitibit app does not allow for breakdown of data (to my knowledge).

12-04-2017 09:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


12-04-2017 09:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
We don't currently have a file transfer from the device to the companion, so you'd need to use the Messaging API.
As your data is probably larger than a single message max size, you'll need to use something like the chunking example here. https://dev.fitbit.com/guides/communications/messaging/

12-04-2017 09:34
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-04-2017 09:34
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks JonFitbit
I had a feeling that was the preferred route.
- How do I get it in the companion if the app is not running?
- How do I get it out of the companion, for me to use/see/save?

12-04-2017 09:45 - edited 12-04-2017 09:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-04-2017 09:45 - edited 12-04-2017 09:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
To my knowledge, the only way is via the Messaging API, which is not ideal with all of the buffering you'll have to do, depending on how much data is collected. Whoops missed the above reply.
You'll likely have to index your chunks so you can make sure your entire payload makes it into the companion, and in the correct order. Once it is in the companion you are free to do whatever you want with it. Getting it out of the companion depends on where you want to see/use/save it. I'd guess most options involve posting the data via fetch, but to where is totally up to you.
You will not be able to communicate to the companion while the device app isn't open. You'll just have to wait until there is a stable connection. You can make the data persist on the device with the FS api if the user closes the app before the data is able to be sent. That way you can make an "outbox" of sorts, to be "delivered" the next time the app opens and is in range of the companion.
