Im building an app that will have multiple users that are going to be sharing data with about 3-5 other users. So I will need to assign each user to a unique group ID so that they will only be able to access the data associated with their groups. What is the best way to generate unique group ID/keys that can be shared among 3-5 different users.
You can try using push().getKey()
to get the unique key.
FirebaseDatabase database = FirebaseDatabase.getInstance();
String key = database.getReference("quiz").push().getKey();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.