Created
December 29, 2018 17:06
-
-
Save bkhezry/8d461c54de067327ef8376bd1261b76c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Request google sign in | |
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient); | |
startActivityForResult(signInIntent, RC_SIGN_IN); | |
//Get selected account data | |
@Override | |
public void onActivityResult(int requestCode, int resultCode, Intent data) { | |
super.onActivityResult(requestCode, resultCode, data); | |
if (requestCode == RC_SIGN_IN) { | |
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data); | |
GoogleSignInAccount acct = result.getSignInAccount(); | |
//TOKEN | |
String token = acct.getIdToken(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment