GeoFire and Firebase Error: Cannot convert value of type 'DatabaseReference' to expected argument type 'Firebase?'

36 Views Asked by At

I'm suddenly getting this error in Xcode:

Cannot convert value of type 'DatabaseReference' to expected argument type 'Firebase?'

let ref = Database.database().reference().child("users_location/")

let geoFire = GeoFire(firebaseRef: ref)

Does anyone know what is going on?

1

There are 1 best solutions below

0
Frank van Puffelen On

You're using GeoFire version 1.1.3, which is ancient (seriously: March 2016) and predates the introduction of the DatabaseReference class.

I recommend upgrading to the latest release of GeoFire, which is 4.3.0 at the time of writing.

Alternatively you could downgrade your version of the Realtime Database SDK to match that timeframe, but I'd recommend against that.