简体   繁体   中英

How to get random UId everytime from Firebase Database?

I am having an activity in which there is a button get uid, I am registering users and it is creating unique id for each user in Firebase database. What I want is when i click the button it will choose the Uid from the available Uids in firebase database and show that id , but the ids must be random and it must be from the database of users who register themselves in the app. How to get random UId everytime?

I don't think it is possible . Since Firebase will return a UID that is associated with a particular user.

I read the docs getIDToken

Unless you have stored the passwords & emails of all the users who registered, then you can request the UID one by one and store them in an array.Then you can do a Random function based of the length of the array.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM