Open Trung15010802 opened 6 months ago
Hi @Trung15010802, Do you experience this same issue with the plugin example app?
I just ran the plugin example app and when I verified the email and returned to the app, I was directed to the profile page.
Hi @Trung15010802, Do you experience this same issue with the plugin example app?
I just ran the plugin example app and when I verified the email and returned to the app, I was directed to the profile page.
I did almost the same as the example app but I didn't use actionCodeSettings. Does that make a difference? As i know, the dynamic link will not available after 2025 so i didn't use it
I experienced the same issue. A workaround is to develop your own email verification screen using StreamBuilder that listens to FirebaseAuth.instance.userChanges()
stream. As soon as the email is verified (snapshot.data!.emailVerified
), you can navigate the user to your desired location in the app.
I did almost the same as the example app but I didn't use actionCodeSettings. Does that make a difference?
I don't think it should, does it work if you configure actionCodeSettings
?
I experienced the same issue. A workaround is to develop your own email verification screen using StreamBuilder that listens to
FirebaseAuth.instance.userChanges()
stream. As soon as the email is verified (snapshot.data!.emailVerified
), you can navigate the user to your desired location in the app.
Events are fired when the following occurs:
When the following methods provided by FirebaseAuth.instance.currentUser are called: reload() unlink() updateEmail() updatePassword() updatePhoneNumber() updateProfile()
As flutter documentation said, I don't see if emailVerified event
When there is a change in the current user's token.
Hi @Trung15010802, if you configure your AuthStateChangeAction like below, does it work?
AuthStateChangeAction((context, state) {
final user = switch (state) {
SignedIn(user: final user) => user,
CredentialLinked(user: final user) => user,
UserCreated(credential: final cred) => cred.user,
_ => null,
};
switch (user) {
case User(emailVerified: true):
Navigator.pushReplacementNamed(context, '/profile');
case User(emailVerified: false, email: final String _):
Navigator.pushNamed(context, '/verify-email');
}
}),
Hi @Trung15010802, if you configure your AuthStateChangeAction like below, does it work?
AuthStateChangeAction((context, state) { final user = switch (state) { SignedIn(user: final user) => user, CredentialLinked(user: final user) => user, UserCreated(credential: final cred) => cred.user, _ => null, }; switch (user) { case User(emailVerified: true): Navigator.pushReplacementNamed(context, '/profile'); case User(emailVerified: false, email: final String _): Navigator.pushNamed(context, '/verify-email'); } }),
Thank you for your support. But it's doesn't work for me.
Hi @Trung15010802, could you please provide a complete minimal reproducible code sample in a repo that we can clone so that we can investigate this?
Thank you
Hi @danagbemava-nc
Here is my source code. Very simple
lib.zip
Hi @tahamaddam, using your code sample, after returning to the app from verifying my email, the app properly redirects me to the home page.
How is your firebase project configured?
Hi @tahamaddam, using your code sample, after returning to the app from verifying my email, the app properly redirects me to the home page.
How is your firebase project configured?
Was this message for me? @danagbemava-nc
Facing similar issue in iOS and I am running example code btw.
Was this message for me? @danagbemava-nc
Sorry @tahamaddam, it was for @Trung15010802
@utsavDave97, can you test on a physical device to see if you still get this issue?
Was this message for me? @danagbemava-nc
Sorry @tahamaddam, it was for @Trung15010802
@utsavDave97, can you test on a physical device to see if you still get this issue?
Yes i have already tested in real device. I configure firebase like this tutorial https://firebase.google.com/docs/flutter/setup?hl=vi&platform=ios
Labeling for further investigation as I cannot reproduce this locally
cc @lesnitsky, maybe you can offer some insight as to why this is happening
Does this method will still work after Firebase Dynamic Links deprecation in August 2025? Maybe this part must be reviewed / refactored.
ActionCodeSettings has no more sense.
https://firebase.google.com/support/dynamic-links-faq
FYI @danagbemava-nc
Working on my side too, maybe it's something related to Firebase config, did you put the right SHA related to your build on Firebase?
In my case, if you don't leave the app the verification never happens. You have to leave the app and re-open it.
Example:
Perhaps this isn't a common flow a real user would go through as they would check their email from the same device. But as a developer building on a simulator or test devices I don't necessarily have email access on the same device. This is the most likely flow I hit the first time I tried and it took me a while to realize what was going on.
Hi , I am facing the same issue while using web version in mobile chrome.
Is there an existing issue for this?
What plugin is this bug for?
Firebase UI Auth
What platform(s) does this bug affect?
Android
List of dependencies used.
flutter pub deps -s list
Steps to reproduce
Steps to Reproduce:
Verify the email.