I’m experimenting with making a simple Geolocation app just for learning purposes. I went to the capacitor doc and am using this code:
const printCurrentPosition = async () => {
const outside = await Geolocation.getCurrentPosition();
setCoords(outside)
setLat(outside.coords.latitude)
setLong(outside.coords.longitude)
setAccuracy(outside.coords.accuracy)
console.log('Current position:', outside.coords.latitude)
}
Sometimes this works, but half the time I get a timeout error:
While I accept that sometimes things take longer that other times…I still think this is weird because I don’t set up a timeout option. Anyone know what is causing this?