Managing location related tasks inside a react-native project can be quite frustrating. I've encountered many problems, for example when getCurrentPosition was always returning me a cached position object, despite of my configurations. For this reason I wrote a getLocation function that tries to incapsulate all the code needed to get a reliable position with a fallback to low accuracy mode.
But getting the real location is only a part of the story, which consists of many other tasks:
- authorize the app to access location
- enable location setting if disabled
- inform the user about what it's going on
So I finally decide to wrote a reusable component which tries to manage all this stuff in one place, which makes use of ...