I recently upgraded my project from Firebase (2.5.1) to Firebase (3.4.0) , setting the following in my subfile:
pod 'Firebase / Database'
pod 'Firebase / Core'
pod 'Firebase / Auth'
Based on the foregoing, I updated my project in accordance with the FirebaseDatabase documentation , since my application mainly uses the database and real-time authentication.
At the moment, I am having very complex errors, and I could not perform the following actions:
private func observeMessages() {
let messagesQuery = messageRef.queryLimitedToLast(25)
messagesQuery.observeEventType(.ChildAdded, withBlock: { snapshot in
let id = snapshot.value!["senderId"] as! String
let text = snapshot.value!["text"] as! String
self.addMessage(id, text: text)
self.finishReceivingMessage()
})
}
I tried to fix it, to the extent possible, to no avail
and my application continues to crash because of this
, Firebase (2.5.1) podfile, , .
- , , , - . .
8/25/16
:
private func observeMessages() {
let messagesQuery = messageRef.queryLimitedToLast(25)
messagesQuery.observeEventType(.ChildAdded) { (snapshot: FIRDataSnapshot!) in
if let id = snapshot.value!["senderId"] as? String, text = snapshot.value!["text"] as? String {
self.addMessage(id, text: text)
self.finishReceivingMessage()
}
}
}