June 2018
Beginner to intermediate
394 pages
9h 2m
English
Most applications allow freedom to delete an account from the application, and we can achieve that by using the delete method of the FirebaseUser object:
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();user.delete() .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { Log.d(TAG, "User account deleted."); } } });
Users will not be able to delete their account if they have not signed in recently; a user can also reauthenticate the credentials to delete the account using the reauthenticate method:
AuthCredential credential = EmailAuthProvider .getCredential("Vinisha@Ashok.com", "Secret");user.reauthenticate(credential)
Read now
Unlock full access