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

Handling Back Navigation in Android Version 14: Dealing with Google Authenticator Popup Dismissal #53

Open
omeremp opened this issue Mar 12, 2024 · 6 comments
Assignees

Comments

@omeremp
Copy link

omeremp commented Mar 12, 2024

In android version 14 when the user clicks outside the pop up, and since the Google Authenticator pop up doesn't throw any exceptions, how can I navigate back to the previous screen?

@incorbador
Copy link
Contributor

Hey @omeremp. Can you please provide more information about your problem?

What pop up do you mean, are you talking about the Google Password Manager popup?
Are you talking about a login or a signup process?
=> Ideally mention the SDK method that you use to trigger that popup, so that I can better unterstand your use case :)

@omeremp
Copy link
Author

omeremp commented Mar 21, 2024

Hey @omeremp. Can you please provide more information about your problem?

What pop up do you mean, are you talking about the Google Password Manager popup? Are you talking about a login or a signup process? => Ideally mention the SDK method that you use to trigger that popup, so that I can better unterstand your use case :)

I'm referring to the signup process. No exception is thrown when I click outside the below pop-up. This issue is occurring in Samsung pop-up. It was working fine on Android 13, but when I updated my phone to Android 14, this issue started occurring.

Screenshot_Credential Manager

@omeremp
Copy link
Author

omeremp commented Apr 1, 2024

@incorbador is there any update ? Is there any further detail required ?

@incorbador
Copy link
Contributor

@omeremp
Hmm interesting. Android throws an exception if the credential creation process is interrupted. We can that one and I am not aware that something has been changed here on Android 14 (Google Pixel). I just ran the example of our passkey package on an Android 14 phone and got the exception (PasskeyAuthCancelledException).
cancellation

I the tested the same example on a Samsung and I got the behaviour you described. It doesn't matter if I use Samsung Pass or Google Credential Manager, in both cases the click outside of the popup doesn't throw that Android exception.

I am afraid that we can't solve this in our packages, this appears to be a decision (or a bug by Samsung's own version of Android). If you click explicitly on "cancel" the exception is thrown btw. (but I guess that is not what you want). I did a bit of research but couldn't find any docs by Samsung.

Therefore, I think the next step here would be to reach out to Samsung.
Does this answer your question or did I get something wrong?

@Raja1234p
Copy link

@incorbador @omeremp I have resolve this issue by catching and handle various events using Widgets and callbacks provided by the Flutter framework.

Step#01 Add class _MyWidgetState extends State with WidgetsBindingObserver {
@OverRide
void initState() {
super.initState();
WidgetsBinding.instance?.addObserver(this);
}

@OverRide
void dispose() {
WidgetsBinding.instance?.removeObserver(this);
super.dispose();
}
@OverRide
void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state);
if (state == AppLifecycleState.resumed) {
// Perform actions when the app is resumed/focused
print('App resumed/focused');
}
}
}

In this example, the _MyWidgetState class implements WidgetsBindingObserver to listen for changes in the app's lifecycle. The didChangeAppLifecycleState method is then overridden to perform actions when the app is resumed or focused.

You can similarly handle other events like input changes, visibility changes. It will print('App resumed/focused'); when user click outside on Samsung pop up , so on resumed you can perform back action

@incorbador
Copy link
Contributor

Hey @Raja1234p. I think that's a good approach to deal with the Samsung issue
=> As Samsung does not expose the information that the challenge has been aborted we have to detect that from the application (this is out of scope of this package though).

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

3 participants