Created
September 12, 2019 00:22
-
-
Save Younes-Charfaoui/806fc77c02d1c65853f534f6556c6cdf to your computer and use it in GitHub Desktop.
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
| import com.google.firebase.FirebaseException | |
| import com.google.firebase.auth.PhoneAuthCredential | |
| import com.google.firebase.auth.PhoneAuthProvider | |
| class PhoneCallbacks(private val listener : PhoneCallbacksListener) : PhoneAuthProvider.OnVerificationStateChangedCallbacks() { | |
| interface PhoneCallbacksListener { | |
| fun onVerificationCompleted(credential: PhoneAuthCredential?) | |
| fun onVerificationFailed(exception: FirebaseException?) | |
| fun onCodeSent( | |
| verificationId: String?, | |
| token: PhoneAuthProvider.ForceResendingToken? | |
| ) | |
| } | |
| override fun onVerificationCompleted(phoneAuthCredential: PhoneAuthCredential?) { | |
| listener.onVerificationCompleted(phoneAuthCredential) | |
| } | |
| override fun onVerificationFailed(exception: FirebaseException?) { | |
| listener.onVerificationFailed(exception) | |
| } | |
| override fun onCodeSent(verificationId: String?, token: PhoneAuthProvider.ForceResendingToken?) { | |
| listener.onCodeSent(verificationId,token) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment