actual class PhoneAuthProvider(val js: firebase.auth.PhoneAuthProvider) {
actual constructor(auth: FirebaseAuth) : this(firebase.auth.PhoneAuthProvider(auth.js))
actual fun credential(verificationId: String, smsCode: String): PhoneAuthCredential = PhoneAuthCredential(firebase.auth.PhoneAuthProvider.credential(verificationId, smsCode))
actual suspend fun verifyPhoneNumber(phoneNumber: String, verificationProvider: PhoneVerificationProvider): AuthCredential = rethrow {
val verificationId = js.verifyPhoneNumber(phoneNumber, verificationProvider.verifier).await()
val verificationCode = verificationProvider.getVerificationCode(verificationId)
credential(verificationId, verificationCode)
}
}
actual interface PhoneVerificationProvider {
val verifier: firebase.auth.ApplicationVerifier
suspend fun getVerificationCode(verificationId: String): String
}
and i cant use the PhoneVerificationProvider. Can you give me the correct code block for phone verification in jsMain?
My missing code block: what do i write instead of todo's?
val phoneVerificationProvider = object : PhoneVerificationProvider {
override val verifier: firebase.auth.ApplicationVerifier
get() = TODO()
override suspend fun getVerificationCode(verificationId: String): String {
TODO()
}
}
coroutineScope.promise {
PhoneAuthProvider(auth).verifyPhoneNumber(phoneNumber, phoneVerificationProvider)
}
i already check this page:
and i cant use the PhoneVerificationProvider. Can you give me the correct code block for phone verification in jsMain?
My missing code block: what do i write instead of todo's?