3

I have got several reports from Android users that they are not receiving the verification email from firebase. I am not sure this is an issue with spam or other filters but I have got no complaints from iOS users, so this is strange and I guess this is an issue with Android only.

Here are my questions:

  • Is there anything I need to do in my client when sending the verification email?
  • Is there a way to see in firebase console if the email is sent or not?

For reference, I am using flutter and I am using email sign-in.

Here is my code

  final newUser = await _auth.createUserWithEmailAndPassword(email: email, password: password);

  try {
    await newUser.user.sendEmailVerification();
  } catch (e) {
    print("An error occured while trying to send email verification");
    print(e.message);
  }

Many thanks!!

M4trix Dev
  • 1,828
  • 3
  • 23
  • 48

2 Answers2

4

Unless there is an outage with Firebase Authentication (which would show up on the status) there is no reason why this code wouldn't send an email without reporting an error.

It is much more likely that the email was sent but not received. The first step I'd take is to check spam filters either in the recipient's mailbox or (if its a company email address) in their infrastructure.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Many thanks for the confirmation. Is there any reason why I have got 20 complaints from android users and zero from ios? is it maybe that android users use gmail and that gmail is more likely to classify the firebase email as spam than other providers, eg yahoo or icloud? – M4trix Dev Jul 07 '20 at 13:46
  • The platform of the client should have no impact here. But if you get this from your real users, you might want to log exceptions from this code in something like Crashlytics. Right now your `print("An error occured while trying to send email verification");` only shows in the user's logging output, which you're unlikely to see after the app is deployed. – Frank van Puffelen Jul 07 '20 at 14:09
  • thanks i have added a crashlytic log before sending the email verification – M4trix Dev Jul 09 '20 at 15:15
2

So for sending the verification email you need to use sendEmailVerification() and I don't think there is a way to see whether the verification mail was sent on Firebase console.

Udit Chugh
  • 681
  • 2
  • 8
  • 26
  • Hi, thanks. I am actually using that method so I am not sure why some android users do not get the email at the first/ – M4trix Dev Jul 07 '20 at 12:20
  • @mactrix have you seen this: https://stackoverflow.com/a/37432106/4830691 ? – Udit Chugh Jul 07 '20 at 12:30
  • 2
    yes, I have seen it but it does not resolve my issue. The last comment in the main answer is suggesting that sendEmailVerification() does not work in some cases, eg. when they are using a google.com account(?), so maybe that is my case. It would be good to have a firebase guru like Frank or Doug here to clarify what is the problem and how to fix – M4trix Dev Jul 07 '20 at 12:45
  • Oh, okay, then let's wait for them. – Udit Chugh Jul 07 '20 at 13:16