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

me.appTimeoutEnabled will not be set

Hi,

 

I'm using SDK2 for my VirtualPartner app. This app has to run even when the display is switched off, so I have to use

    me.appTimeoutEnabled = false

like descriped in the documentation.

 

In detail I'm doing:

import { me as device } from "device";
// Disable app timeout
import { me } from "appbit";

// Start off training console.log("Timeout, before: " + me.appTimeoutEnabled); me.appTimeoutEnabled = false; // Disable timeout console.log("Timeout, after: " + me.appTimeoutEnabled);

The result however is:

app/index.js:1937,3
[‎07‎:‎17‎:‎25]Timeout, before: true
app/index.js:1939,3
[‎07‎:‎17‎:‎25]Timeout, after: true

So obviously me.appTimeoutEnabled will not be set to "false". In fact the app will be stopped after two minutes when the display will be switched off.

 

Does anybody know what to do?

 

Regards

Capitano

Best Answer
10 REPLIES 10

Oops.  Not a correct response...

Best Answer
0 Votes

@JonFitbit@SunsetRunner

 

Is someone of the specialists able to help?

 

Regards

Capitano

Best Answer
0 Votes

Hello,

I did some additonal tests with the Ionic and the Versa simulator - I small app that doesn't anything alse expcept the above mentioned code. - And it still doesn't work.

 

me.appTimeoutEnabled

will not be changed.

 

Is there nobody out there who develpes an app for Versa which should use the companion GPS and has other or similair experiences?

Perhaps this doesn't work in the simulator and I have to work with the watch at once?

 

Regards

Capitano

Best Answer
0 Votes

FWIW, I just ran your code on my computer and got...

 

[HOST][10:53:50 AM]App Closed
[HOST][10:53:50 AM]App Startedapp/index.js:7,3
[10:53:50 AM]Timeout, before: undefinedapp/index.js:8,3
[10:53:50 AM]Timeout, after: false

Have you deleted your app from the simulator and re-ran it as a fresh install?

 

EDIT:  I also added a first line which defined timeout as true and got the "true" response followed by the false.

 

 

Best Answer
0 Votes

Hi @FlyFrosty,

 

thanks for your efforts - did you choose SDK 2?

I got this "undefined" message, if in the package.json SDK 1 is chosen.

 

You also have to implement a small program - a kind of timer or loop - so that the app stays active for more then 2 minutes - then you get the message that the OS terminates the app - the lines above are just an excerpt of my program.

 

Here's the output in the console:Ashampoo_Snap_2018.12.01_17h23m25s_001_.jpg

 

 

Regards.

Capitano

 

Regards.

Best Answer
0 Votes

I did not change the SDK version (I didn't even look at it), so I do not know which one I used.   

 

Just out of curiosity, did you delete the app from the simulator and try and re-rerun it fresh?  (Apps tab, Actions dots...).

 

I am not a professional programmer, but if it helps to see how I use it,  I posted my Indoor Track app to GitHub (https://github.com/FlyFrosty/Indoor-Track).  I use the appTimeoutEnabled functions in it to keep it from closing out if a lap is greater than two minutes (lines 173 and 182).  It was compiled in SDK version 2.

 

The only other thing I can think of is if the Fitbit compiler is getting confused between the import {me}... and import {me as device}.  It should not, but...

 

 

Best Answer
0 Votes

Thanks once more.

 

In my opinion I did it exactly your way...

 

I tried all other things. Deinstalled the app from (both) simulators and reinstalled it.

I also removed the other me-import - it didn't change anything.

 

Sad...

Capitano

 

Best Answer
0 Votes

I am also facing the same issue, someone kindly suggest if you have any suggestions.

Best Answer
0 Votes

I have the same issue using SDK 3.1

Does anyone have a solution to this?

 

Edit:

me.appTimeoutEnabled = false;
console.log("Timeout, after: " + me.appTimeoutEnabled);

This did not work for me on the simulator and I always got true out.

But I put this on my versa watch and it does not turn off by it self so it looks like it is working on the watch

Best Answer

This actually worked for me. At least it prints false as i want it to. I hope the app won't actually stop now. Thank you.

Best Answer
0 Votes