How To Alert Users When The Username Is already Taken?

Hi Koders,
i am creating singup screen. i have a question,
when user clicks on submit button and the filled username is already taken by a member then show him error message. but how to chech that username in firebase if it is taken or not?

i had created this logic but it didnt work

NOTE: i had put firebase auth (google) in another screen, uid is the google user id. i had stored that id in tiny db with tag uid.

Logic is simple

In firebase get value block add in (value If Tag Not There ) Add left it blank and then when firebase gets the value then if value is equal to the ( value If Tag Not There ) then the username is available and if the username have a value and its contains what ever your details then the username is not available.

1 Like