geolocation.watchPosition() not working in android real device

#1

Hi i am learner in ionic and present in my application i am trying to get user location using below code but its not working i mean lat and longs are coming in android real device ,Is there any better solution for getting user current location can some one help me please

this.geolocation.getCurrentPosition().then((resp) => {
}).catch((error) => {
console.log(‘Error getting location’, error);
});

let watch = this.geolocation.watchPosition();

watch.subscribe((data) => {
this.data = data;
console.log("----->Watch latitude" + data.coords.latitude);
console.log("-----> Watch logitude" + data.coords.longitude)
console.log("-----> Watch accuracy" + data.coords.accuracy)
});