07-13-2019 14:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-13-2019 14:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi,
I have implemented an app for Fitbit Ionic using Fitbit Studio. The app is a simple game but I don't know how I can store data when a user is finished with the game. I'm new to the Fitbit app development. Could some one tell me how I can store the game data? Thanks a lot.
Answered! Go to the Best Answer.

- Labels:
-
JavaScript
Accepted Solutions
08-27-2019 13:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-27-2019 13:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Such files are stored on the watch. If you want them elsewhere, you have to use File Transfer to get them to the companion; then you can use fetch or WebSockets to send them to a server.
Gondwana Software

07-13-2019 14:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


07-13-2019 14:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Have a look at onunload and the File System API.
Gondwana Software

08-27-2019 04:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-27-2019 04:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks. Can I get access to the files after my app is published? And if yes, is it possible to read the files via the web API?

08-27-2019 13:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-27-2019 13:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Such files are stored on the watch. If you want them elsewhere, you have to use File Transfer to get them to the companion; then you can use fetch or WebSockets to send them to a server.
Gondwana Software

09-04-2019 03:06 - edited 09-04-2019 04:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-04-2019 03:06 - edited 09-04-2019 04:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thank you. I also have another question. What happens if I use file transfer to send a json file from the app to the companion but not send it to a server? Can I still get access to the json file after the app is published by Fitbit?

09-04-2019 13:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


09-04-2019 13:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Publishing the app won't make any difference to your ability to access data. That's the good news.
The bad news is that the file on the companion isn't accessible outside of the companion. You can't get at it using a file manager. Even inside the companion, it's really more like a variable in memory than a file in storage.
Gondwana Software

09-04-2019 13:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-04-2019 13:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
companion, I should store the data to a server right after receiving the
file via companion. Right? I just want to store users game data somewhere
accessible.

09-04-2019 13:50
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


09-04-2019 13:50
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Yes, I'm afraid so. If you really want an on-companion-device solution, you could send it to a 'server' running on your companion device; ie, a local program that can intercept the fetch() or WebSocket output from your companion code.
Gondwana Software

09-04-2019 13:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-04-2019 13:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
it possible to do it via the app itself rather than the companion?

09-04-2019 13:58
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


09-04-2019 13:58
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Sorry. 😞
Gondwana Software

