0

I am using FirebaseAuth.getInstance().getCurrentUser().getEmail() (Federated Google-Sign in provided by Firebase)

Most of the time I am getting back the logged in user's email address. But sometimes its resulting null. I can see the user has a gmail.com address but it still does not return.

Am I missing something?

mark922
  • 1,136
  • 2
  • 11
  • 20
LAX_DEV
  • 2,111
  • 3
  • 19
  • 29
  • 2
    Can you add more of your code (_[not your whole file](https://stackoverflow.com/help/mcve)_)? From what you've posted it's impossible for us to help - your single line of code you provide [matches what is given in the docs](https://firebase.google.com/docs/auth/android/manage-users) so I suspect you're doing something else wrong - maybe **when** you're calling it... the first thing that comes to my mind when you say it is `null` only _sometimes_ is that it's probably related to an issue with some asynchronous code you wrote. – JeremyW Jul 12 '18 at 21:14
  • I don't have anything asynchronous. Its a simple one-liner I use to display the email address and also use it in the developer payload for in-app purchases. Is getEmail() asynchronous? I didn't think so... – LAX_DEV Jul 12 '18 at 21:55

0 Answers0