Replies: 1 comment 1 reply
-
We don't listen to react-navigation onFocus and onBlur events. You can handle those events yourself and remove UserLocation when https://reactnavigation.org/docs/use-focus-effect the view goes out of focus. See also the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am developing an App which - among other things - tracks your location. The user is asked to give location permission always. Always means the App is allowed to access the location, even when the App is brought to the background.
I am using
rnmapbox
to show the user location on a map. The<Mapbox.MapView />
is implemented in aTabNavigator
from reactnavigation. This means, that once a component has been mounted inside theTabNavigator
(like the<Mapbox.MapView />
), it never gets unmounted, until the App is terminated. Currently I am testing the App on a real device and I am observing the following behaviour. Once the user has granted access to use the locationAlways
and the user has opened the<Mapbox.MapView />
Tab and brings the App to the background (without terminating it), the App still uses the location. This also happens, when the user changes the Tab. I assuem this is because<Mapbox.MapView />
needs the location in order to show<Mapbox.UserLocation />
and once the user has granted the permissionAlways
,<Mapbox.MapView />
cconstantly uses the location.I expect
<Mapbox.UserLocation />
or<Mapbox.MapView />
to not always use the location. I expect there to be some sort of a toggle or flag that I can set in order to turn off the accessing of the users locatin by the framework.Is there something like this, or is this a bug?
Beta Was this translation helpful? Give feedback.
All reactions