firebase / firebase/geofire-objc
GeoFire Query Gives Only Own Location
- 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
Assessment
This issue has not been assessed yet.