Skip to content

GeoFire Query Gives Only Own Location #123

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

Open
SamaritanMachine opened this issue Jun 21, 2019 · 0 comments
Open

GeoFire Query Gives Only Own Location #123

SamaritanMachine opened this issue Jun 21, 2019 · 0 comments

Comments

@SamaritanMachine
Copy link

Using GeoFire 3.0 and Swift 4

The problem is when I query locations with given radius, it gives only one location and the location is own location. When I run the app from simulator and it gives only one location again and this location is simulator's location. I can't get any other users' locations.

I want to get all location entries in database according to given radius.

Here is my setLocation func:

     self.geoFire.setLocation(location, forKey: uid) { (error) in
          }

And this is my query:

self.geoFire.query(at: self.userLocation!, withRadius: 2.0).observe(.keyEntered) { (str, loc) in
            
            print("*****", str, loc.coordinate.longitude, loc.coordinate.latitude)

        }

Database Structure is here!

I'm truly sure that all these locations are in given radius.

Also, I'm giving this tip on console.

Using an unspecified index. Your data will be downloaded and filtered
on the client. Consider adding ".indexOn": "g" at
/Users/6VRAyf3HFZfFXUH5TWBtB6v1om22 to your security rules for better
performance

What does it mean?

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

1 participant