hi guys need a help, how to turn on mobile gps on button click…
i need to turn on gps if gps turned off…
here is my code:
this.geolocation.getCurrentPosition().then((resp) => {
this.lat = resp.coords.latitude;
this.lng = resp.coords.longitude;
this.latlong = resp.coords.latitude + ',' + resp.coords.longitude;
console.log('loaction: ' + this.latlong)
}).catch((error) => {
console.log('Error getting location', error);
});
this code working fine if gps is on. and not working if gps is off as expected. now i need to show an alert to turn on gps if gps is off like this