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

how to pass onClick event from setting to app?

ANSWERED

Hi, sorry for that one to...

i have a button in my settings, i want it to trigger a function in my app.

with a toggle i would easily get the boolean content using JSON.parse(evt.data.newValue) , but with the button i don t know...

how can i send intels to app/*.index using the onClick() event of my button in settings.jsx?

thank you for your time and forgivness!

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

There isn't a direct way to do this, but you can get there:

 

1. In settings, write a value into settings storage // settingsStorage.setItem('some-key', 'some-value');

2. In companion, listen for the setting storage change event

3. In companion, send a value to the device via the messaging api

4. In the device, listen for the message and perform your action.

 

https://dev.fitbit.com/build/guides/settings/

https://dev.fitbit.com/build/guides/communications/messaging/

View best answer in original post

Best Answer
2 REPLIES 2

There isn't a direct way to do this, but you can get there:

 

1. In settings, write a value into settings storage // settingsStorage.setItem('some-key', 'some-value');

2. In companion, listen for the setting storage change event

3. In companion, send a value to the device via the messaging api

4. In the device, listen for the message and perform your action.

 

https://dev.fitbit.com/build/guides/settings/

https://dev.fitbit.com/build/guides/communications/messaging/

Best Answer

Thank you, i get it now !!!

Best Answer
0 Votes