I want to do tasks after the user makes no decision on the location's permission. I have tried the following:
navigator.geolocation.getCurrentPosition((pos) => {
let lat = pos.coords.latitude;
let long = pos.coords.longitude;
console.log(lat, long);
console.log("User granted permission");
}, (error) => {
console.error(error);
console.error("User didn't grant permission");
}, {
timeout: 3000,
maximumAge: 3000,
enableHighAccuracy: true
});
I have set timeout
and maximumAge
attributes to 3000
ms, but it didn't work anymore. The error will only be triggered if the user closes the permission pop-up. How can I detect if the user makes no decision after 3 seconds? Thank you.
from How to detect timeout of user location permission if user didn't make decision after 3 seconds?
No comments:
Post a Comment