07-05-2021 16:13
07-05-2021 16:13
I build an app that records and stores the heart rate in a file and syncs them with the companion. I am not sure why it happens but after I added setting.jsx, I see the log saying "App closed in 3 seconds" and the app doesn't try to sync anymore. So, I got rid of setting.jsx, it works fine again.
Does anyone know the correlation between "index.jsx" and the app closing?
Below is the code of index.jsx. This is the code uploaded to Fitbit's Github for using OAuth application.
function mySettings(props) {
return (
<Page>
<Section
title={<Text bold align="center">Fitbit Account</Text>}>
<Oauth
settingsKey="oauth"
title="Login"
label="Fitbit"
status="Login"
authorizeUrl="https://www.fitbit.com/oauth2/authorize"
requestTokenUrl="https://api.fitbit.com/oauth2/token"
clientId=""
clientSecret=""
scope="settings profile activity heartrate location nutrition sleep social weight"
/>
</Section>
</Page>
);
}
registerSettingsPage(mySettings);