firebase / firebase/geofire-objc

GeoFire Query Gives Only Own Location

Open
#123 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
447
Forks
183
PR merge metrics
No merged PRs in 30d

Description

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!][1]][1]

[1]: https://i.stack.imgur.com/MQxxT.png

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.