iOS Question Recover Firebase Authentication error Message

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hello all,

implementing this resource - https://www.b4x.com/android/forum/t...uthenticate-your-users-google-facebook.68625/ - sometimes an email is already registered in Firebase using Google and when is tried to register the same email using Facebook it's possible to see the log in B4i:

B4X:
Error signing in: Error Domain=FIRAuthErrorDomain Code=17012 "An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address." UserInfo={FIRAuthErrorUserInfoNameKey=ERROR_ACCOUNT_EXISTS_WITH_DIFFERENT_CREDENTIAL, [email protected], FIRAuthErrorUserInfoUpdatedCredentialKey=<FIROAuthCredential: 0x281d816d0>, NSLocalizedDescription=An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.}

It's important to recover this message in code because app could check what's happening and take some action, but I really didn't find out how to do this. There isn't any event raised after authentication error and the app returns to login screen without any notice.
How could this log be captured when the app is called back from Facebook or Google Authentication?

Thanks!
 
Top