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

How to access a settings page in a new app

I am trying to make a new app with 2 settings, and I've created a settings/index.jsx with the appropriate items in it, but I don't see how to access that in the app itself now that I have it running on my fitbit sense?

What am I missing?

Best Answer
0 Votes
3 REPLIES 3

You need to 'catch' the setting changes in your companion app, and send them from there to the watch app using File Transfer or Messaging.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

I think I have that, I've got:

 

 

messaging.peerSocket.addEventListener("message", (evt) => {
  if (evt && evt.data && evt.data.key === "exerciseMode") {
    exerciseMode = evt.data.value;
  }
  
  if (evt && evt.data && evt.data.key === "sleepMode")
    {
      sleepMode = evt.data.value;
      
      if (sleepMode == true)
        {
          nightInterventionCount = 0;
        }
    }
});

 

 

 

But I don't see how to call the settings, so that they can be changed in the first place?

 

settings/index.jsx 

 

function mySettings(props)
{
  return 
  (
    <Page>
      <Section
        title={<Text bold align="center">Turn on Exercise Mode?</Text>}>
        <Toggle
          settingsKey="exerciseMode"
          label="Exercise Mode"
          />
      </Section>
      <Section
        title={<Text bold align="center">Turn on Sleep Mode?</Text>}>
        <Toggle
          settingsKey="sleepMode"
          label="Sleep Mode"
          />
      </Section>
    </Page>

  );  
}


registerSettingsPage(mySettings);

 

 

 

Best Answer
0 Votes

Hi, have a look at this example for color-setting. Maybe it helps to show the relations:

settings-in-action 

Best Answer
0 Votes