Mapbox location request prompt in ios ionic app

I have a React app that I turn into a phone app with Ionic and capcitorjs. A mapbox card is a big part of the app, and when you open the app, it asks for permission to access the phone’s location with a fairly normal prompt. This is fine and the map centers the user correctly (using @ capacitor / geolocation) when the app is opened. But when the user pushes on the mapboxgl.GeolocateControl button that centers the user and adds the blue location point, the prompt is weird and I can not see where to change it. The question of using the user’s location (despite already having permission) is:

“: //” Would like to use your current location

Do not allow | Okay

Where can I change this prompt? It does not appear on Android, so this is only an iOS issue. For the first prompt requesting geographic location, it can be edited in the Info.plist file in XCode, but this “Would like to …” prompt does not even appear in Info.plist. It appears to be caused by mapbox. Can the prompt be changed with @ capacitor / geolocation?

Here are the relevant dependencies for this npm app:

"ionic": "^5.4.16",
"mapbox-gl": "^2.5.1",
"@capacitor/core": "^3.2.4",
"@capacitor/geolocation": "^1.1.0",
"@mapbox/mapbox-sdk": "^0.13.2",
"react": "^17.0.2",
"@capacitor/android": "^3.2.4",
"@capacitor/app": "^1.0.3",
"@capacitor/cli": "^3.2.4",
"@capacitor/ios": "^3.2.4",

Leave a Comment