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

Timer App on Versa 2 Stops on Screen Timeout

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 Answer
0 Votes
5 REPLIES 5

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.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

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 Answer
0 Votes

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 Answer
0 Votes

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 Answer
0 Votes

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
0 Votes