I use Google sign-in in an Android app and save a link to their profile picture URL in the database.
In the past, I would get the complete URL, starting with this one of these, for example:
https://lh3.googleusercontent.com/{random stuff}/photo.jpg
https://lh4.googleusercontent.com/{random stuff}/photo.jpg
https://lh5.googleusercontent.com/{random stuff}/photo.jpg
https://lh6.googleusercontent.com/{random stuff}/photo.jpg
Ever since Google Play Services updated this (I think in 8.3?) I only get
/{random stuff}/photo.jpg
This obviously won't link to a picture.
Here is my code:
GoogleSignInAccount acct = result.getSignInAccount();
if (acct != null)
{
String profilePicPath = "";
if (acct.getPhotoUrl() != null) {
profilePicPath = acct.getPhotoUrl().getPath();
}
}
What am I doing wrong?
EDIT: I believe what I am doing wrong is I added getPath() after the URL.
You will need Enabling G+ API on google console.
enter link description here
You will need to initialize the GoogleApiClient
enter link description here
enter link description here
Hope this helps