I have a countdown timer app that works fine on Versa, Versa Lite, and Ionic; however, installed on the Versa 2 if the timer is running and the screen times out, the timer stops. When the screen is activated, the timer starts again.
Do I need to wait for the Versa 2 SDK, or is there some setting for Versa 2 the user needs to set?
Or, is my app incompatible for Versa 2, although the Fitbit Gallery is showing it as compatible?
Best AnswerCould it be that you're using display.autoOff? That will have no effect on Versa 2.
Your app should continue to run when the screen is off, although ontick events won't happen. If you're relying on those, consider setInterval.
Best AnswerYes, in my onTick event, I'm using:
display.autoOff = false;
display.on = true;
I guess I'll have to implement setInterval for Versa @2.....
Thanks.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
App timeout is different to the display timeout.
// Disable app timeout
import { me } from "appbit";
if (me.appTimeoutEnabled) {
console.log("Timeout is enabled");
}
me.appTimeoutEnabled = false; // Disable timeout
Best AnswerYes, I have me.appTimeoutEnabled = false; in my code that is executed when the app starts.
Do I also need this in my onTick event handler?
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Sorry, I missed this from your original post.
The ontick event only fires when the screen is on. You'll need to use either setTimeout() or setInterval() if you want it to occur while the screen is off.
Best Answer