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

GPS failure back again?

Hi all,

 

in my opinion after the latest update to OS 27.30.5.16 GPS functions crash again.

 

Does anybody observe problems with geolocation.getCurrentPosition(locationSuccess, locationError) again?

 

My Virtual Partner app - which I'm using since the update before - ran without any problems for half an hour. Now it crashes again. The Ionic resets without any message in the console log.

 

Capitano

 

Best Answer
0 Votes
4 REPLIES 4

Can you provide a code sample? I assume you're doing this on the device?

Best Answer
0 Votes

Hello @JonFitbit,

 

By now I'm not sure what's the reason for the error. Since the last OS update I get the "app message queue full " error, although my app was running without problems before the update.

 

Actually I check your hint at

https://community.fitbit.com/t5/SDK-Development/App-msg-queue-full/m-p/2313147#M1634

But to be honest  - I don't understand the code fully by now.

 

Capitano

 

 

 

 

 

 

 

Best Answer
0 Votes

Hello @JonFitbit,

 

Here's the core/frame of my application:

 

function getPosition() {

     geolocation.getCurrentPosition(locationSuccess, locationError);

}  // end function getPosition

 

function locationError(error) {

    // message output

}  // end function locationError

 

function locationSuccess(data) {

     // var definitions 

     // Message output

     // calculating distance that was run

  } // end function locationSuccess

 

myFunction02 = setInterval(getPosition, 1000);  // calling function every second

 

function updateDisplay() {

  // reading heartrate sensor, doing some calculations and outputs

}  //* end function updateDisplay

 

function startAction() {

  // Begin monitoring the sensor

  hrm.start();

  // And update the display every second

  myFunction01 = setInterval(updateDisplay, 1000);

}  // end function startAction

 

Don't know if that helps or gives you an idea where the error could happen.

I'm just thinking about to start only one intervaltimer and to include the call of the getPosition function in the updateDisplay function.

 

Capitano

Best Answer
0 Votes

Hello,

 

I have new findings:

geolocation.watchposition() seems to work - the app is running for several minutes - I still have it to test for a longer period.

 

Now I don't use geolocation.getposition() with setIntervall() anylonger. Should to be one of the reasons for the failure.

 

But for me it also seems that locationError(error) will not be entered.

Before the latest OS-update this function was entered as long no GPS connection was established and I could use it to show the missing connection in the display.

Now I can only see that locationSuccess(data) will be entered...

 

Should it work that way?

Best Answer
0 Votes