Using GeoFire queries in Swift does not give useful output

后端 未结 2 739
鱼传尺愫
鱼传尺愫 2021-01-20 02:45

I\'m pretty desperate right now because I\'m trying to use GeoFire on my Firebase Database to find nearby users. I\'m pretty much stuck for two days now. I searched Google a

2条回答
  •  Happy的楠姐
    2021-01-20 03:40

    Try writing the locations with GeoFire like this. You don't need to store them under that location key.

    let ref = FIRDatabase.database().reference()
    let geofireRef = ref.child("users_locations")
    let geoFire = GeoFire(firebaseRef: geofireRef)
    
    geoFire?.setLocation(myLocation, forKey: uid!)
    

提交回复
热议问题