03-02-2018 02:08 - edited 03-02-2018 02:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

03-02-2018 02:08 - edited 03-02-2018 02:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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).
03-02-2018 10:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


03-02-2018 10:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Thanks for the feedback, we're aware of some issues and inconsistencies with the getItem method. It's actually different for each type of component, and we'll aim to resolve this in a future update.
08-26-2018 03:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-26-2018 03:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
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?
06-02-2019 09:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-02-2019 09:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
so wait, is:
JSON.parse(settingsStorage.getItem("some_key")).name
the 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.

06-02-2019 09:58
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-02-2019 09:58
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Welcome to Fitbit development 😉 moreover, things like this will probably never get fixed due to "backwards compatibilty".

