settings/index.jsx
<TextInput
title="API key"
settingsKey="apiKey"
/>companion/settings.js
import { settingsStorage } from 'settings';
console.log(settingsStorage.getItem('apiKey'));
Writing some 'api key value' in the TextInput component, then the log outputs:
{"name":"api key value"}Isn't this strange? I mean, I expected it to be right the value, and not a stringified object with a 'name' property whose content is a 'value' (not even a name).
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.
Half a year later this is still the same and not documented at all... will this be fixed in the future or do you just won't fix/ignore it for backwards compatibility?
so wait, is:
JSON.parse(settingsStorage.getItem("some_key")).namethe way to actually get at the value? It actually seems to work, i'm just kinda blown away that this isn't at least addressed a tiny bit in the docs.
Best AnswerWelcome to Fitbit development 😉 moreover, things like this will probably never get fixed due to "backwards compatibilty".
Best Answer