Created
June 26, 2019 10:34
-
-
Save e-lin/409b6240d70f34cb19cf109f57efa4fa to your computer and use it in GitHub Desktop.
Log in Thing with Google and Firebase APIs
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
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