1

I am trying to get the Google profile Photo Url using GoogleSignInAccount class, after signing in with GoogleSignIn:

[...]
GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);
Uri photoUrl = MainActivity.account.getPhotoUrl();
[...]

but photoUrl is always null. I read on Stackoverflow (GoogleSignInAccount getPhotoUrl() return null) that it return NULL if Google+ is not well configurated. The main problem is: Google+ has closed on 2 april 2019.

How can I get the Google profile photo URL now?

Zoe
  • 27,060
  • 21
  • 118
  • 148

1 Answers1

0

there is nothing wrong with your code and from the official documentation

Note that any of the profile fields can be null, depending on which scopes you requested and what information the user's profile includes.

photo url for the Google account. Only non-null if requestProfile() is configured and user does have a Google+ profile picture.

And since google plus has been deleted , that makes a sense that getPhotoUrl returns null

ismail alaoui
  • 5,748
  • 2
  • 21
  • 38