Bạn có chắc chắn muốn xóa bài viết này không ?
Bạn có chắc chắn muốn xóa bình luận này không ?
Firebase Authentication – Send Reset Password Email / Forgot Password | Android
Firebase Authentication – Send Reset Password Email / Forgot Password | Android
In previous post, we have known way to implement Sign up, Sign in/out, Verify Email. Today, we continue to take a look at way to send Reset Password Email in case User forgot Password.
*Note: This tutorial bases on code in related post:
Firebase Authentication – How to Sign Up, Sign In, Sign Out, Verify Email | Android
We just add an Activity to App for handling Reset Password Email and some statements to old code for logic.
I. Way to do
1. Add Firebase Auth to Android App
Read Firebase Authentication – Sign Up, Sign In, Sign Out, Verify Email and follow steps to enable and implement Firebase Auth in your Android App.
2. Send a password reset email
With the sendPasswordResetEmail()
method:
FirebaseAuth auth = FirebaseAuth.getInstance();
auth.sendPasswordResetEmail(emailAddress)
.addOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(@NonNull Task task) {
if (task.isSuccessful()) {
// do something when mail was sent successfully.
} else {
// ...
}
}
});
We can customize the email template in Firebase console:
II. Practice
1. Goal
We will build an Android App that can:
- create Account, sign in/sign out, send email verification.
- display current status/user information with verified email status. (all things above are from previous tutorial)
- send reset password email in case user forgot password.
2. Technology
- Gradle 2.3.3 – Android Studio 2.x – Firebase Android SDK 11.x
More at:
Firebase Authentication – Send Reset Password Email / Forgot Password | Android





