12-04-2019 08:11
12-04-2019 08:11
Hi,
I managed to store some JSON files on the Fitbit Ionic smartwatch private folder. I noticed that, in order to access the JSON files, I need to read them via Fitbit studio. Is there another way to read the content of my JSON files? I mean, can I read the files online using Fitbit web app, dashboard, etc? It's a bit inconvenient for me to run the Fitbit studio every time to read the data and due to some reasons, I do not want to store them on a server. Thanks for your answer in advance!
Answered! Go to the Best Answer.
Best Answer12-10-2019 13:44
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
12-10-2019 13:44
There's no public storage of files, but you could post them from the companion to file.io, like this:
function postData(data) {
fetch("https://file.io", {
body: `text=${escape(JSON.stringify(data))}`,
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
method: "POST"
})
.then(function(response) {
return response.json();
}).then(function(data) {
console.log(`Created ${file}: ${JSON.stringify(data)}`);
});
}
12-10-2019 13:44
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
12-10-2019 13:44
There's no public storage of files, but you could post them from the companion to file.io, like this:
function postData(data) {
fetch("https://file.io", {
body: `text=${escape(JSON.stringify(data))}`,
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
method: "POST"
})
.then(function(response) {
return response.json();
}).then(function(data) {
console.log(`Created ${file}: ${JSON.stringify(data)}`);
});
}
12-10-2019 13:57 - edited 12-10-2019 13:58
12-10-2019 13:57 - edited 12-10-2019 13:58
Thanks for your answer. Does the app need to be published on Fitbit for the JSON to be posted to file.io through companion? Because I have not published my apps and prefer not to as the apps are for research purpose targeting specific groups of users,
Best Answer12-10-2019 14:01
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
12-10-2019 14:01
file.io might not be the right solution for you in this case. You'll need to store the files on a server somewhere though.
You don't need to publicly publish your application, but you will need to upload it to gam.fitbit.com so you can install it on multiple devices.