MaikuB / flutter_appauth

A Flutter wrapper for AppAuth iOS and Android SDKs
269 stars 238 forks source link

Android: authorizeAndExchangeCode is not returns any response #495

Open mdikcinar opened 1 month ago

mdikcinar commented 1 month ago

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 commented 1 month ago

https://github.com/MaikuB/flutter_appauth/pull/496