Hello Ionic 2 funs and developers,
I created an example application (similar to this) to test geolocation on android device.
Application work normally on firefox browser using ionic serve
, but the problem appears when application is running on my android device (4.4) with ‘location’ option is off.
Geolocation part of the code looks like in the doc
let options = {timeout: 5000, enableHighAccuracy: true, maximumAge: 60000};
Geolocation.getCurrentPosition().then(
(resp) => {
console.log("Geolocation : " + resp.coords.latitude + ", " + resp.coords.longitude);
// center on the location
},
(error) => {
console.log(error);
},
options
);
and when ‘location’ option is off I expect to obtain an error PositionError.TIMEOUT
or PositionError.POSITION_UNAVAILABLE
, however the onError callback is never executed on the device.
If somebody knows how to deal with the problem, please share your experience
Cheers