With this code, I am getting only one value from Geolocs just key and location, not a nearby location.What is wrong with it
var geoFireRef: DatabaseReference?
var geoFire: GeoFire?
var myQuery: GFQuery?
func Geofire() {
geoFireRef = Database.database().reference().child("Geolocs")
geoFire = GeoFire(firebaseRef: geoFireRef!)
self.geoFire?.setLocation(currentLocation!, forKey:Auth.auth().currentUser!.uid)
myQuery = geoFire?.query(at: currentLocation!, withRadius: 100)
myQuery?.observe(.keyEntered, with: { (key, location) in
if key != Auth.auth().currentUser?.uid
{
let ref = Database.database().reference().child("Users").child(key)
ref.observeSingleEvent(of: .value, with: { (snapshot) in
let id = snapshot.key
})
}
})
}