android - Signup Firebase user without e-mail address -
i'm using following steps sign-up new firebase user. there way me set username
parameter in future user can login using username
& password
?
also, there way sign using username
& password
,ie, not have option of e-mail id.
i've gone through following solution, doesn't seem efficient. suppose there better way of doing so.
firebase login , signup username
private firebaseauth auth; //get firebase auth instance auth = firebaseauth.getinstance(); //create user auth.createuserwithemailandpassword(email, password) .addoncompletelistener(signupactivity.this, new oncompletelistener<authresult>() { @override public void oncomplete(@nonnull task<authresult> task) { toast.maketext(signupactivity.this, "createuserwithemail:oncomplete:" + task.issuccessful(), toast.length_short).show(); // if sign in fails, display message user. if sign in succeeds // auth state listener notified , logic handle // signed in user can handled in listener. if (!task.issuccessful()) { toast.maketext(signupactivity.this, "authentication failed." + task.getexception(), toast.length_short).show(); } else { startactivity(new intent(signupactivity.this, mainactivity.class)); finish(); } } });
you can add domain behind username
register user < username > @summersapp.com.
note make impossible user reset password if forget it, since firebase uses email address send password reset email.
Comments
Post a Comment