File tree 1 file changed +2
-8
lines changed
firebase-auth/src/iosMain/kotlin/dev/gitlive/firebase/auth
1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -77,20 +77,14 @@ actual class PhoneAuthProvider(val ios: FIRPhoneAuthProvider) {
77
77
actual fun credential (verificationId : String , smsCode : String ): PhoneAuthCredential = PhoneAuthCredential (ios.credentialWithVerificationID(verificationId, smsCode))
78
78
79
79
actual suspend fun verifyPhoneNumber (phoneNumber : String , verificationProvider : PhoneVerificationProvider ): AuthCredential {
80
- val verificationId: String = ios.awaitResult {
81
- if (verificationProvider.delegate != null ) {
82
- ios.verifyPhoneNumber(phoneNumber, verificationProvider.delegate as ? FIRAuthUIDelegateProtocol , it)
83
- } else {
84
- ios.verifyPhoneNumber(phoneNumber, null , it)
85
- }
86
- }
80
+ val verificationId: String = ios.awaitResult { ios.verifyPhoneNumber(phoneNumber, verificationProvider.delegate, it) }
87
81
val verificationCode = verificationProvider.getVerificationCode()
88
82
return credential(verificationId, verificationCode)
89
83
}
90
84
}
91
85
92
86
actual interface PhoneVerificationProvider {
93
- val delegate: Any ?
87
+ val delegate: FIRAuthUIDelegateProtocol ?
94
88
suspend fun getVerificationCode (): String
95
89
}
96
90
You can’t perform that action at this time.
0 commit comments