Skip to content

Instantly share code, notes, and snippets.

@pavan5208
Created July 18, 2021 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavan5208/4ca9fbdbb9c35caef3d222d22ef6da3f to your computer and use it in GitHub Desktop.
Save pavan5208/4ca9fbdbb9c35caef3d222d22ef6da3f to your computer and use it in GitHub Desktop.
fun signInWithCustomToken(customToken: String) {
customToken?.let {
auth.signInWithCustomToken(it)
.addOnCompleteListener(this) { task ->
if (task.isSuccessful) {
// Sign in success, update UI with the signed-in user's information
val user = auth.currentUser
} else {
// If sign in fails, display a message to the user.
Toast.makeText(
baseContext, "Authentication failed.",
Toast.LENGTH_SHORT
).show()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment