I'm trying to get the gender and birthday from the Google provider using Firebase AuthUI. Here is my code.
AuthUI.IdpConfig googleIdp = new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER)
.setPermissions(Arrays.asList(Scopes.EMAIL, Scopes.PROFILE, Scopes.PLUS_ME))
.build();
startActivityForResult(
AuthUI.getInstance().createSignInIntentBuilder()
.setLogo(R.drawable.firebase_auth_120dp)
.setProviders(Arrays.asList(
new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build(),
googleIdp))
.setIsSmartLockEnabled(false)
.setTheme(R.style.AppTheme_Login)
.build(),
RC_SIGN_IN);
In onActivityResult:
IdpResponse idpResponse = IdpResponse.fromResultIntent(data);
I got idpResponse
, but it only included idpSecret
and idpToken
. How can I access other requested fields for profile like gender and birthday? I can access common fields email, name, photo etc with
FirebaseAuth.getInstance().getCurrentUser();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…