Requests GPS permission on load
Instantly asks for GPS permission when using Map, without further calling code to activate Puck. Tested on iOS Edit: After some tries to isolate the problem i found the trigger: .updateSettings(LocationComponentSettings(enabled: false) I guess this is not what should trigger a gps permission request from iOS.
Used 0.6.x before and there things worked as expected. Now updated to 2.1.0 and this behaviour started to show.
We want to have control over when gps permission is shown, as we want to be hyper nice to our users and give a lot of explanation why we need the permission beforehand and NOT just throw the iOS (with Plist reason string) dialog immediately at their faces on app start.
Environment: Flutter 3.22.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision b0850beeb2 (2 weeks ago) • 2024-07-16 21:43:41 -0700 Engine • revision 235db911ba Tools • Dart 3.4.4 • DevTools 2.34.3
@landliebe Do you enable location indicator to be shown on the map right away? If so, location authorization is automatically requested on iOS.
Before posting here in issues i changed all occurences in code of LocationComponentSettings to: .updateSettings(LocationComponentSettings(enabled: false)
Just to be safe and not overseeing something
Ok just finished some more testing and trying things: .updateSettings(LocationComponentSettings(enabled: false) Triggers the GPS permission request of iOS. I am pretty confident that this is not how this is supposed to go :)
+1, same problem. There are no permissions calls anywhere in the code, set LocationComponentSettings.enabled false, but no result. When launching the application, the permissions request window pops up instantly.
I had the same error.
I solved the issue avoiding call mapboxMap!.location.updateSettings on start. I call only after manage location permission by my own implementation.
By default, the location is disabled on Mapbox.