I have this method to fetch current location by clicking button it will fetch current location . I want to fetch location without clicking that button .
getLocationHandler = () =>{
navigator.geolocation.getCurrentPosition(pos =>{
const coordsEvent ={
nativeEvent :{
coordinate : {
latitude : pos.coords.latitude,
longitude : pos.coords.longitude
}
}
};
this.pickLocationHandler(coordsEvent);
},
err => {
console.log(err);
alert("Fetching the position failed,Please pick one manually")
})
}