Created
July 8, 2016 22:13
-
-
Save ianbarber/f3e4713d45adfd3611a5cec7bc810a79 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
if (opr.isDone()) { | |
// If the user's cached credentials are valid, the OptionalPendingResult will be "done" | |
// and the GoogleSignInResult will be available instantly. We can try and retrieve an | |
// authentication code. | |
GoogleSignInResult result = opr.get(); | |
handleSignInResult(result); | |
} else { | |
// If the user has not previously signed in on this device or the sign-in has expired, | |
// this asynchronous branch will attempt to sign in the user silently. | |
opr.setResultCallback(new ResultCallback<GoogleSignInResult>() { | |
@Override | |
public void onResult(@NonNull GoogleSignInResult googleSignInResult) { | |
handleSignInResult(googleSignInResult); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment