Skip to content

Instantly share code, notes, and snippets.

@a914-gowtham
Last active September 17, 2021 16:01
Show Gist options
  • Save a914-gowtham/c5b3747b80f67ad47e64d2cfa195e687 to your computer and use it in GitHub Desktop.
Save a914-gowtham/c5b3747b80f67ad47e64d2cfa195e687 to your computer and use it in GitHub Desktop.
private fun signInWithPhoneAuthCredential(credential: PhoneAuthCredential) {
FirebaseAuth.getInstance().signInWithCredential(credential)
.addOnCompleteListener { task ->
if (task.isSuccessful) {
Timber.v("signInWithCredential:success ${taskId.result?.user?.uid}")
} else {
Timber.v("signInWithCredential:failure ${task.exception}")
if (task.exception is FirebaseAuthInvalidCredentialsException)
context.toast("Invalid verification code!")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment