I want to get message sent from a specific user to another. I am unable to achieve this. When I use the following code, I get the message from receiver. What I need is to get message particular recieverid
to particular senderid
.
My Database Snapshot
Here is my code:
Database.database().reference().child("chats")
.queryOrdered(byChild: "receiverid")
.queryEqual(toValue: "xEdACTcUWeOwrdIqjxeP5t5y4Kg2")
.observe(.childAdded, with: { snapshot in
let msgDict = snapshot.value as! [String: Any]
print(msgDict)
})