ShUbHaM raWat
ShUbHaM raWat

Reputation: 7

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?

Upvotes: 0

Views: 1013

Answers (1)

Pc hobbit
Pc hobbit

Reputation: 96

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.

Upvotes: 1

Related Questions