1

Here is my code:

function gpsManager() {

}

gpsManager.prototype = {

  /*
   * We need High Accuracy.
   */
  requestHighAccuracy: function(cb) {
    if(cb)
      this.callback = cb;
    cordova.plugins.locationAccuracy.request(this.callback, this.onRequestFailure, cordova.plugins.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY);
  },

  onRequestFailure: function(error) {
    console.error("Accuracy request failed: error code="+error.code+"; error message="+error.message);
    if(error.code == 4)
      this.requestHighAccuracy(null);
  }

}

And I get the error where I call requestHighAccuracy. Why does this happen and which is the right way to implement this ?

Alessandro
  • 175
  • 1
  • 12

0 Answers0