You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the user gives the app Location Permission - Always the Maps SDK uses the location always, when the App is in the foreground (opened) or in the background (closed, but not terminated).
Expected behavior
I expect to be able to set a property that tells the SDK 'Use the location now' or 'Do not use the location when the App is in the background', 'Do not access the location, eventhough you have permission always' ... or something similiar.
Notes / preliminary analysis
This is a thing arising with React-Navigation and Tab Navigator. When using a Tab Navigator, React Naigation does not unmount a component once its mounted inside a Tab Navigator. I though that <UserLocation /> is the component responsible for using the location all the time, so I tried to conditionally render it with isFocused = false and appState === 'active'. isFocused becomes true when the Tab Navigator focussed on the map. appState === 'active becomes true when the app is in the foreground. However, even with the precautions on the <UserLocation/>, the SDK always uses the location, doesnt really matter if the app is in the foreground or in the background, if the corresponding Tab in the Tab Navigator is focussed or not. So I assume the <MapView> is responsible for using the location always?
Additional links and references
No response
The text was updated successfully, but these errors were encountered:
Mapbox Implementation
Mapbox
Mapbox Version
10.7.0
Platform
iOS
@rnmapbox/maps
versionrnmapbox/maps#main
Standalone component to reproduce
appSettings is an event listener, basically this
Observed behavior and steps to reproduce
When the user gives the app
Location Permission - Always
the Maps SDK uses the location always, when the App is in the foreground (opened) or in the background (closed, but not terminated).Expected behavior
I expect to be able to set a property that tells the SDK 'Use the location now' or 'Do not use the location when the App is in the background', 'Do not access the location, eventhough you have permission always' ... or something similiar.
Notes / preliminary analysis
This is a thing arising with
React-Navigation
andTab Navigator
. When using aTab Navigator
,React Naigation
does not unmount a component once its mounted inside aTab Navigator
. I though that<UserLocation />
is the component responsible for using the location all the time, so I tried to conditionally render it withisFocused = false
andappState === 'active'
.isFocused
becomestrue
when theTab Navigator
focussed on the map.appState === 'active
becomestrue
when the app is in the foreground. However, even with the precautions on the<UserLocation/>
, the SDK always uses the location, doesnt really matter if the app is in the foreground or in the background, if the corresponding Tab in theTab Navigator
is focussed or not. So I assume the<MapView>
is responsible for using the location always?Additional links and references
No response
The text was updated successfully, but these errors were encountered: