firebase-kotlin-sdk
firebase-kotlin-sdk copied to clipboard
Authentication error message is different for Android and iOS.
trafficstars
Hi! I have an application in which in case of Authentication error I show the prompt what went wrong.
Code in shared module :
fun sendEmailLink() {
_userAuthState.value = Response.Empty
settings.putString(CURRENT_EMAIL_KEY, _emailAddressInput.value)
sharedScope.launch {
useCases.sendEmailLink.invoke(_emailAddressInput.value).collect { response ->
if (response == Response.Success(true)) startTimer()
_sendLinkState.value = response
println("Printing response in viewmodel : " + response)
if(response is Response.Error) println("Error message : " + response.message)
}
}
}
What is important in here are the println calls
I couldn't figure out why my iOS app shows such a weird error message, so I added println for debugging and tried to sign in with empty string on each platform
Output on Android :
I/System.out: Printing response in viewmodel : Error(message=Given String is empty or null)
I/System.out: Error message : Given String is empty or null
Output on iOS
printing response in viewmodel : Error(message=Error Domain=FIRAuthErrorDomain Code=17034 "An email address must be provided." UserInfo={NSLocalizedDescription=An email address must be provided., FIRAuthErrorUserInfoNameKey=ERROR_MISSING_EMAIL})
Error message : Error Domain=FIRAuthErrorDomain Code=17034 "An email address must be provided." UserInfo={NSLocalizedDescription=An email address must be provided., FIRAuthErrorUserInfoNameKey=ERROR_MISSING_EMAIL}
I fixed this in #297. I assume it will be available in the 1.6.2 release