Created
September 18, 2018 17:24
-
-
Save adrianhall/1299476e99f94de277409b51cbb3ed7f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | |
super.onActivityResult(requestCode, resultCode, data) | |
when (requestCode) { | |
GOOGLE_SIGN_IN -> { | |
val task = GoogleSignIn.getSignedInAccountFromIntent(data) | |
try { | |
val account = task.getResult(ApiException::class.java) | |
Log.d(TAG, "Authenticated with Google: token = ${account.idToken}") | |
model.federateWithGoogle(account) | |
[email protected]() | |
} catch (error: ApiException) { | |
toast("Google Authentication failed: ${error.message}") | |
} | |
} | |
else -> { | |
callbackManager.onActivityResult(requestCode, resultCode, data) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment