Reputation: 1541
I’m building a React-Native social media app with a feature that allows you to find other users who are nearby. I know React Native has location services capabilities, but I’m not sure how I would implement this type of background location tracking. Anyone know?
Upvotes: 1
Views: 275
Reputation: 13926
You can solve the problem through the library officially supported by React-native.
react-native-background-geolocation
Links you can refer to for troubleshooting
Upvotes: 0
Reputation: 666
I hope you have built something like this by now, but still, I will try to help you out here.
Get user's current location and store it in ES/MongoDB. You will do this for all other users as well. So, now you have a data source containing all users' current locations.
Now do a query to ES/MongoDB to get users with their current locations in X miles radius of your current user's location.
Voila you have this feature ready.
PS: To get user's current location you can use the react-native-location
package.
Upvotes: 1