05-21-2020 10:08
05-21-2020 10:08
Hi there,
sorry for this one...
i m very unfamiliar with programming and totally new to fitbit sdk.
it sounds very basic but i m struggling. i simply want to wire the value of toggle btton in my settings to a var boolin my app.
in my *.jsx
<Toggle
settingsKey="toggle"
label="myToggle"
/>
then in my app/index.js
import * as messaging from "messaging";
import document from "document";
let myBool =new Boolean(true);
messaging.peerSocket.onmessage = evt => {
console.log(`App received: ${JSON.stringify(evt)}`);
if (evt.data.key === "toggle" && evt.data.newValue)
{
myBool = (JSON.parse(evt.data.newValue)).name;
console.log(`New date: ${myBool}`);
}
}
that is not working, could someone show me the wright writing for this?
thank you !
Answered! Go to the Best Answer.
05-22-2020 21:12
05-22-2020 21:12
@Slumberlander wrote:that is not working, could someone show me the wright writing for this?
thank you !
05-22-2020 21:12
05-22-2020 21:12
@Slumberlander wrote:that is not working, could someone show me the wright writing for this?
thank you !