10-11-2019 11:12
10-11-2019 11:12
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 Answer10-11-2019 11:30
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
10-11-2019 11:30
Could 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 Answer10-11-2019 12:02
10-11-2019 12:02
Yes, 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 Answer10-21-2019 01:48
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.
10-21-2019 01:48
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 Answer10-21-2019 10:15
10-21-2019 10:15
Yes, 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 Answer10-21-2019 11:59
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.
10-21-2019 11:59
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