cordova-plugin-geolocation
cordova-plugin-geolocation copied to clipboard
Do not work if the location previously was turn off and we turn on during the app usage
Bug Report
Problem
Something very strange is happening to me, If I run my app (in which I'm using this plugin) directly it doesn't works, but just before launching my app, If I run google maps and locate my self, then run my app again it works without any issue, otherwise it keep falling into error method of getCurrentPosition method
Command or Code
this.locationAccuracy.request(this.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY).then(() => {
Geolocation.getCurrentPosition({ enableHighAccuracy: true }).then(loc => {
alert('Position detected successfully' + loc.coords.accuracy);
}).catch(err => {
alert(err);
});
}).catch(deny => {
alert('You denied the location');
});
Environment, Platform, Device
Oneplus 3T
Version information
Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
Try
Geolocation.getCurrentPosition(
{
enableHighAccuracy: true,
maximumAge: 0 /* Force the plugin to request the positon and not use cached positions */
})
Closing as stale.