Trying to get photo from signed in profile. But always return null. Name and email return values, trouble only with photo.
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestProfile()
.requestEmail()
.build();
mGoogleApiClient = new GoogleApiClient.Builder(StartActivity.this)
.enableAutoManage(StartActivity.this, StartActivity.this)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build();
acct = gResult.getSignInAccount();
String name = acct.getDisplayName(); //okay, value != null
String email = acct.getEmail(); //okay, value != null
Uri photoUri = acct.getPhotoUrl() //not okay, value == null
Why does it happen so? Account signed, email and name got, but photo always fail.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…