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

Android: authorizeAndExchangeCode is not returns any response #495

Open
mdikcinar opened this issue May 17, 2024 · 2 comments
Open

Android: authorizeAndExchangeCode is not returns any response #495

mdikcinar opened this issue May 17, 2024 · 2 comments

Comments

@mdikcinar
Copy link

mdikcinar commented May 17, 2024

Hi, i have an issue on some android phones not all of them. I did some debugging and the issue is when i call authorizeAndExchangeCode it opens a browser activity with mainActivity.startActivityForResult but at the same time also onDetachedFromEngine is working. So when i come back from browser activity, onAttachedToEngine is working and in onActivityResult pendingOperation becomes null and returns false therefore i can't authenticate the user. But if i call authorizeAndExchangeCode second time it returns success directly without open a browser activity and user logins the app successfully.

Happens on Android api 34, api 30. But i have tried with another phone works on api 34 it worked well without this issue.
Currently using flutter_appauth: 6.0.4

Is there any idea how can i solve the problem?

@mdikcinar
Copy link
Author

#496

@MaikuB
Copy link
Owner

MaikuB commented Jul 17, 2024

Whilst you have a PR on this, I don't see steps on how to properly reproduce. Furthermore, what you mentioned around onDetachedFromEngine being called sounds odd as it would mean entire Flutter engine is destroyed. This is typically something that happens more when the app has been killed or the Flutter activity hosting the app has been killed (e.g. if you forced the device only have one activity). What you say has implications for other plugins, including official ones from Google. The plugin is following a similar the Google sign in plugin too. As such as I'm inclined to think the root cause hasn't been identified

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

2 participants