Unique ID when user signup or register

I want to show an unique user ID no. in my app

When any user signup or register the application then a unique id will be generate
when 1st user join ID No.-1 second user ID No.-2 and so on…
user join the ID+1

Like this -
image

image

I hope you understand plz help me

Whenever user register, call the length of the users registered from the database and use +1 and set it as userd ID

OR
In firebase set tag name and value as userd id and 0 and
whenever user register successfully call this tag and use +1 and also save this tag value with this new value also set it as user ID too

simple

1 Like