I am working with a geolocation plugin with ionic2. When the application loads in the browser, it asks for permission. But it does not get the position when calling getcurrentposition. I am using FireFox browser.
The console log shows an error:
EXCEPTION: Not available (in promise): false
I need to pass the location, if available, or null for another function based on the success or failure of the getcurrentlocation call.
Here is the code snippet:
public test(){
Geolocation.getCurrentPosition().then((resp) => {
console.log (resp.coords.latitude);
console.log (resp.coords.longitude);
this.callclockin(resp.coords.latitude, resp.coords.longitude);
}).catch((error) => {
this.callclockin("", "");
});
}
source
share