Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth crash when checking if user is Email-Verified #619

Open
Tommyten opened this issue Sep 5, 2024 · 6 comments
Open

Auth crash when checking if user is Email-Verified #619

Tommyten opened this issue Sep 5, 2024 · 6 comments

Comments

@Tommyten
Copy link

Tommyten commented Sep 5, 2024

When checking if a user is email verified using Firebase auth the app crashes with the following message:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FIRUser emailVerified]: unrecognized selector sent to instance 0x600002c16800'

The setup is pretty simple. With a logged in user I execute this piece of code:

Napier.e("About to crash")
Firebase.auth.currentUser?.let {
    Napier.e("Did get current User")
    val mailVerified = it.isEmailVerified
    Napier.e("Unreachable on iOS | mailVerified: $mailVerified")
}

on iOS it leads to a crash; on Android it doesn't. I didn't test any other platforms yet. This crash only came up, after upgrading gitlive firebase auth from version 1.12.0 to 2.1.0

@nbransby
Copy link
Member

nbransby commented Sep 5, 2024

@siarhei-luskanau is this likely to be caued by https://github.com/GitLiveApp/firebase-kotlin-sdk/pull/592/files and need to be changed to emailVerified()?

@siarhei-luskanau
Copy link
Contributor

@siarhei-luskanau is this likely to be caued by https://github.com/GitLiveApp/firebase-kotlin-sdk/pull/592/files and need to be changed to emailVerified()?

I will have a look

@siarhei-luskanau
Copy link
Contributor

@Tommyten I have tried to reproduce this issue on my project and isEmailVerified works well for me. Please provide more information about issue. I have tested this case there . Anonymous Sign-in provider is used in Firebase web console.

@izadiegizabal
Copy link

i don't have a reproducible project to share, but i am also getting this error by accessing AuthState.isEmailVerified since i upgraded to 2.1.0. reverting back to 2.0.0 seems to fix the issue.

@siarhei-luskanau
Copy link
Contributor

2.1.0 version has the commit Updated firebase-cocoapods to "11.1.0". I think it is necessary to update the firebase-ios-sdk dependency version to 11.1.0 in iosApp/iosApp.xcodeproj/project.pbxproj file in ios project.

In my case it looks like:

/* Begin XCRemoteSwiftPackageReference section */
		92C05B532C972C51003DFD70 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
			isa = XCRemoteSwiftPackageReference;
			repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
			requirement = {
				kind = exactVersion;
				version = 11.1.0;
			};
		};
/* End XCRemoteSwiftPackageReference section */

@izadiegizabal
Copy link

you are right @siarhei-luskanau! i had to update my pods, it's now fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants