I'm using the plugin:
Within the project I created a simple example:
home.html
My Location
home.ts
//Chamado por um botão
start()
{
this.geolocation.getCurrentPosition(opts).then((resp: any) => {
console.log("latitude:", resp.coords.latitude);
console.log("longitude:", resp.coords.longitude);
}).catch((err: any) => {
console.log('ERRO:', err.message);
console.log('Code:', err.code);
});
}
In iOS it works perfectly, console.log
emits something like:
latitude: -0000000000
longitude: -0000000000
In Android neither error message, I receive even a Timeout message, only an empty object:
ERRO: Only secure origins are allowed (see: ...)
code: 1
I'm testing the App on an actual Android device (I tested it on more than one device) by installing the APK manually and in "Settings & Location" the application appears as allowed.
I am NOT using
liveload
How do I solve this problem?