Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot set settings from index.js

ANSWERED

Hi!

I can't set any setting from index.js

 

All of those give the error "TypeError: Cannot create property 'code' on boolean 'true'"

 

settingsStorage.setItem("time", JSON.stringify( {selected:[0],values:[{"name": "12hs"}]} ));
settingsStorage.setItem("lang", JSON.stringify( {"selected":[0],"values":[{"name":"English"}]} ));
settingsStorage.setItem("zpad", "false");
settingsStorage.setItem("eightBg", "false");
settingsStorage.setItem("alpha", JSON.stringify(0.05));
settingsStorage.setItem("style", JSON.stringify( {"selected":[0],"values":[{"name":"Suunto", "value":0}]} ));
settingsStorage.setItem("dataFont", JSON.stringify( {"selected":[0],"values":[{"name":"Roboto"}]} ));

 

HELP! 😞

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

That's right. The Settings interface is only in the Companion API. It's up to you to communicate relevant settings to the watch. I recommend file transfer. There are some prefab solutions and examples in Fitbit's OSS github repo.

Peter McLennan
Gondwana Software

View best answer in original post

Best Answer
0 Votes
3 REPLIES 3

Superficially, that looks okay to me. Is this definitely in your companion/index.js?

Is the import correct? Could you be accidentally changing the imported binding somewhere?

Peter McLennan
Gondwana Software
Best Answer
0 Votes

App cannot reach settings even if I imported it right? Settings only can be accesed into companion?

Best Answer
0 Votes

That's right. The Settings interface is only in the Companion API. It's up to you to communicate relevant settings to the watch. I recommend file transfer. There are some prefab solutions and examples in Fitbit's OSS github repo.

Peter McLennan
Gondwana Software
Best Answer
0 Votes