How to create a group chat with firebase in Android app
1 answer
Try adding users to the group under a separate child. for example let's say one child contains all users and then create another root from your database which is a group.
root
-users
--user1
--user2
--user3
-group1
--user1
--user10
-group2
--user5
--user3
You can add these users to different groups by reading all users and then sorting them in different groups or when you create a user for the first time adding it to both users and any group.
+1
source to share