Reputation: 1
I'm developing a Flutter web application and encountering an issue with retrieving the user's location on iOS web browsers, specifically Chrome and Safari.
Problem Details:
When the user is prompted to grant location permission and they allow it, my application is still unable to get their location. This issue occurs consistently on both Chrome and Safari on iOS devices. However, if I manually change the location permission settings in Safari from "Ask" to "Allow," the application successfully retrieves the user's location.
Steps to Reproduce:
Open the Flutter web app in Safari or Chrome on an iOS device. When prompted, allow location access. Notice that the application fails to retrieve the location. Go to Safari settings, change location access from "Ask" to "Allow." Open the app again, and it retrieves the location successfully.
What I have Tried is :
I used the geolocator package to request and retrieve the user's location. I checked the implementation to ensure permissions were being requested correctly. I manually tested the app on different iOS devices and browsers. I verified that the issue does not occur on non-iOS browsers or devices.
Upvotes: 0
Views: 72
Reputation: 137
90% problem caused by Simulator itself. Just enable Feature -> Location -> City Run (or something similar)
Upvotes: 0