Hello there,
I understand that Geolocation requires https to run and get the current location, even though we need to debug the application on the device some how.
So when I try to run with:
$> ionic cordova run android --livereload -cs
dev server running: http://localhost:8100/
[INFO] Development server running
Local: http://localhost:8100
External: http://192.168.1.103:8100
And with the code:
getMyPosition() {
let positionOptions = { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true };
this.geolocation.getCurrentPosition(positionOptions).then((resp) => {
console.log(resp.coords.latitude + ", " + resp.coords.longitude);
alert(resp.coords.latitude + ", " + resp.coords.longitude);
}).catch((error) => {
console.log('========= Error gettinglocation - liveload =======');
console.log(error.message); // Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).
});
}
I wonder if must be a workaround to solve this situation, after all everybody needs to develop debuging the app all the time.
So far I could not see this getCurrentPosition working on apps made with Ionic v3 (3.6.0) and Angular 4 (4.1.3) and cordova-plugin-geolocation 2.4.3
Does anybody have any idea how to solve this? Or everybody just the the Geolocation working when install the app?