identify GPS mobile phonegap

61 views Asked by At

I am using the plugin geolocation iOS phonegap and everything seems to work very well, iOS I identify if the GPS is enabled (default) this way:

  function success(pos) {
    $scope.latitud = pos.coords.latitude
    $scope.longitud =  pos.coords.longitude;
  };

  function error(err) {
    alert("El servicio de GPS en tu dispositivo esta desactivado.");
  };

  navigator.geolocation.getCurrentPosition(success,error);

If I can not get latitude and longitude, logically, I determine that the PS is in IOS desativado and this works very well, but not Android. I wanted to know if anyone has been able to create an option or find an option to identify whether the GPS is on or not, Since I imagine that mine is not the best way to determine.

0

There are 0 answers