Skip to content

Instantly share code, notes, and snippets.

@e-lin
Created June 26, 2019 10:34
Show Gist options
  • Save e-lin/409b6240d70f34cb19cf109f57efa4fa to your computer and use it in GitHub Desktop.
Save e-lin/409b6240d70f34cb19cf109f57efa4fa to your computer and use it in GitHub Desktop.
Log in Thing with Google and Firebase APIs
private fun trySignIn() {
Log.d(TAG, "Signing in with tocken" + tocken)
val credential = GoogleAuthProvider.getCredential(token, null)
FirebaseAuth.getInstance().signInWithCredential(credential)
.addOnSuccessListener(this, { result ->
val user = result.user
Log.d(TAG, "signInWithCredential ${user.displayName} ${user.email}")
finish()
})
.addOnFailureListener(this, { e ->
Log.e(TAG, "signInWithCredential onFailure", e)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment