Skip to content

Instantly share code, notes, and snippets.

@Younes-Charfaoui
Last active September 13, 2019 21:11
Show Gist options
  • Save Younes-Charfaoui/0e6c7becfadc6edc1e6c34b4c96f3350 to your computer and use it in GitHub Desktop.
Save Younes-Charfaoui/0e6c7becfadc6edc1e6c34b4c96f3350 to your computer and use it in GitHub Desktop.
override fun onVerificationCompleted(credential: PhoneAuthCredential?) {
if (credential != null && storedVerificationId != null)
signInWithPhoneAuthCredential(credential)
else {
Toast.makeText(
this,
"Something went wrong, please try later.",
Toast.LENGTH_LONG).show()
finish()
}
}
override fun onVerificationFailed(exception: FirebaseException?) {
Toast.makeText(
this, "Something went wrong, try again later please.",
Toast.LENGTH_LONG).show()
finish()
}
override fun onCodeSent(
verificationId: String?,
token: PhoneAuthProvider.ForceResendingToken?
) {
storedVerificationId = verificationId!!
resendToken = token!!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment