I am making a chat activity using firebase. I list all of the users contact name in my recyclerview and when a particular contact is clicked, i open a new activity called chat.In which user sends a message.To push the message to firebase i make use of foll code
mMessagesDatabaseReference = mFirebaseDatabase.getReference().child("messages");
Now my child is named "messages", but all users will be able to see everyone's message as i have only one child. My question is how should i name my child in firebase database should that it could be unique.For eg if A messages to B and B messages to A,i want a separate child for them.Similarly for other users. Can somebody please help me?