Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After granting location permissions to the Geolocation API, it will request permissions again when you refresh the page. This phenomenon is occurring on iOS. #139

Closed
LeeSangUk2 opened this issue Oct 26, 2023 · 1 comment

Comments

@LeeSangUk2
Copy link

LeeSangUk2 commented Oct 26, 2023

If you refresh the page after initially granting location permissions, you will be prompted for location permissions again and will need to grant permission again. Currently this only occurs on iOS. Is there a way?

The tested iOS versions are 16.2 and 17.

This is the code implemented when retrieving location information.

<script>
        var options = {
            timeout: 15000,
            enableHighAccuracy: true,
            maximumAge: 86400000,
        };

        function success(pos) {
            var crd = pos.coords;

            alert('Your current position is:');
            alert(`Latitude : `+crd.latitude);
            alert(`Longitude: `+crd.longitude);
        };

        function error(err) {
            alert(`ERROR(): `+err.message);
        };
        navigator.geolocation.getCurrentPosition(success, error, options);
</script>
@tomayac
Copy link
Contributor

tomayac commented Oct 26, 2023

Responded in w3c/permissions#422.

@tomayac tomayac closed this as completed Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants