Firebase childbyAutoId returns the same strange key every time

Something really weird happens when using childByAutoId. Instead of getting a unique ID, I get the following key every time:

-------------------0

      

I know the keys are generated with client side timestamps, so I tried to run my code through the iOS simulator and the actual device, still the same result.

I'm not doing anything interesting in my code, but here's it for your reference:

func sendRandomMessage() {
        let firebaseRootRef = Firebase(url:firebaseRootUrl)
        let newMessageRef = firebaseRootRef.childByAutoId()
        println(newMessageRef.key)
    }

      

I am using Firebase 2.3.0

+3


source to share


1 answer


There was an error in the Firebase SDK for iOS 2.3.0 that caused this issue.



This was fixed in 2.3.1. See https://www.firebase.com/docs/ios/changelog.html

+1


source







All Articles