I want to integrate google sign in to my app, when user first sign in I will create an account bind to this, so I need some profiles like gender, locale, etc. and I tried as the google-sign-in doc and quick-start sample shows:
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build();
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build();
when click to sign in I will call:
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
startActivityForResult(signInIntent, RC_SIGN_IN);
sign in successful, I can get a data structure GoogleSignInResult in onActivityResult, from GoogleSignInResult I can get a GoogleSignInAccount, which only contains DisplayName, email and id. but when in https://developers.google.com/apis-explorer/#p/, I can get profiles like gender, locale. Is there anything I missed?
and I tried google plus api, it seems that I can get what I want. but don't know how to use, the doc says create client like this:
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Plus.API)
.addScope(new Scope(Scopes.PLUS_LOGIN))
.addScope(new Scope(Scopes.PLUS_ME))
.build();
but when I use this, click signin button will cause app crash.
Update: problems when update to new version of google sign in Missing api_key/current key with Google Services 3.0.0