How do I send a Firebase email notification when registering?

So, I turned on the email / password in the dev console and everything works fine. Except that I should receive a confirmation email by email, which I entered, but I do not receive it. I thought he did it automatically, but apparently this is not the case.


Registration Method:

public void signUp(View v) { String email = emailET.getText().toString(); String password = passwordET.getText().toString(); mAuth.createUserWithEmailAndPassword(email, password) .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { Log.d("AD", "createUserWithEmail: " + task.isSuccessful() + task.getException()); if (!task.isSuccessful()) { createDialogSignUpError( getApplicationContext().getResources().getString(R.string.signUpFailedET), getApplicationContext().getResources().getString(R.string.signUpFailedEM), getApplicationContext().getResources().getString(android.R.string.ok)); Toast.makeText(SignUp.this, task.getException().toString(), Toast.LENGTH_LONG).show(); } else if (task.isSuccessful()) { Toast.makeText(SignUp.this, "Registration Successful.", Toast.LENGTH_SHORT).show(); } } }); } 

It should be sent, but unfortunately this is not the case. I read SO somewhere that you need to add a method or something else to send an email, and it is not in the docs, but it was not Java.


Edit

According to here , it is only supported on iOS and the Internet. This is quite surprising, because in the end, Android Android, and Google - Firebase. Is this even possible when creating a personalized sent email?


Edit 2: To be more clear, Android has an email sender such as C #. This would be a better solution if there is no API for this.

+5
source share
2 answers

Now you can plug in any Firebase spaces in your inbox by copying your own email sender using Firebase Cloud Functions. Here is an example here . Of course, this means more work than just setting up as built-in options, but at least it means that we can do whatever we need. :)

+1
source

Now according to the updated firebase documentation

Here's how to send a verification letter to the user, which in your case after creating the account and allowing the user to log in, and then send him / her a notification that he should check the account, and then the next login will be blocked until he / she will not check (I think this is better than getting the user to open his email first)

Send user a confirmation email

You can send an email confirming the address to the user using the sendEmailVerification method. For instance:

 FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); user.sendEmailVerification() .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { Log.d(TAG, "Email sent."); } } }); 
+1
source

All Articles