In firebase i'm trying to retrieve data stored in the firebase realtime database by using the childByAutoID() to give the data a unique identifier but the problem is i'm not entirely sure how to achieve this?
func retData(){
rootRef.child("users").child(userID).ChildByAutoID().observeEventType(.Value){
(snap: FIRDataSnapshot) in
self.simpleLabel.text = snap.value?.description
}
}
Json data structure
-userID
-childByAutoID
-player1
-email
userID, becoz i dont see it in your Json tree - DravidianChildByAutoId()is a method that you use when writing to the database, whileobserveEventType()is used for reading. Are you trying to listen for whenever a user is added to the list of users? - Frank van Puffelen