Right now I have a latitude and longitude for each user, under the child(uid).child("Coordinates"). Now I want to rather(or also) store the latitude and longitude as a geohash, to be user by Geofire. Where am I going wrong?
guard let locValue: CLLocationCoordinate2D = manager.location?.coordinate else { return }
print("locations = \(locValue.latitude) \(locValue.longitude)")
latestLocation = ["latitude" : locValue.latitude, "longitude" : locValue.longitude]
let lat = locValue.latitude
let lon = locValue.longitude
dict = CLLocation(latitude: lat, longitude: lon)
print("dict", dict)
if let locationDictionary = latestLocation {
databaseRef.child("people").child(uid).child("Coordinates").setValue(locationDictionary) /////this above is for the separate entries, below I tried to also add it as a geohash.
let geofireRef = Database.database().reference().child("people").child("CoordinatesB")
let geoFire = GeoFire(firebaseRef: geofireRef)
geoFire.setLocation(CLLocation(latitude: lat, longitude: lon), forKey: "firebase-hq")
}//////