Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fetch documents around a certain location #33

Open
Isuru-Nanayakkara opened this issue May 18, 2020 · 1 comment
Open

How to fetch documents around a certain location #33

Isuru-Nanayakkara opened this issue May 18, 2020 · 1 comment

Comments

@Isuru-Nanayakkara
Copy link

Hello,

This might be a simple question but I'm having a hard time trying to figure out how to do this.

I'm developing an iOS app which transmits user's last known location periodically. My Firebase setup looks like this.

Screenshot 2020-05-18 at 18 12 28

It has a users collection. Each user has the aforementioned last location coordinate.

What I'm trying to do now is, given a location and a radius, fetch the set of users who fall within that radius.

I know I can initiate a query like this.

let circleQuery = geoFirestore.query(withCenter: center, radius: 10)

But not sure what to do after that. How do I get the results from this query?

@fury21
Copy link

fury21 commented Jun 19, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants