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

On Android, call to authenticate immediately returns CANCELED #8

Closed
kylethompson002 opened this issue Sep 12, 2022 · 5 comments
Closed
Assignees
Labels
invalid This doesn't seem right

Comments

@kylethompson002
Copy link

Describe the bug

When I make the call to FlutterWebAuth2.authenticate, the web view does not open, and it immediately returns PlatformException(CANCELED, User canceled login, null, null).

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

When FlutterWebAuth2.authenticate is called, a web view should open to the given url.

Screenshots

If applicable, add screenshots to help explain your problem.

Device (please complete the following information!)

  • Device: OnePlus LE2115
  • OS: Android 12
  • Browser: Chrome
  • flutter_web_auth_2 version: 1.1.2

Additional context

I can only reproduce this issue once our android app is built in release mode and distributed through the Play store. I cannot reproduce it when building locally with Android Studio in either debug or release mode. It also can not reproduce this issue in our iOS app (same flutter code).

@kylethompson002 kylethompson002 added the bug Something isn't working label Sep 12, 2022
@ThexXTURBOXx
Copy link
Owner

ThexXTURBOXx commented Sep 13, 2022

Thanks for reporting this issue. I have taken a look at your fork and noticed that you have removed the observer lines. Did that help by any chance?
Depending on that, I will search for better solutions. I cannot reproduce the behavior in an app of mine, that's why.
Also: Have you by chance tested the behavior on other (Android) devices also?

@kylethompson002
Copy link
Author

Thanks for your reply. I've been doing some more testing today. Removing the observer lines did not solve the issue. I have observed the issue on both of my Android devices (OnePlus 9 and Google Pixel XL). I'm a little puzzled as to why this only happens for me in release mode 🤔. I'm wondering if it could be an issue with CustomTabs.

@ThexXTURBOXx
Copy link
Owner

It also puzzles me that it does not work after removing those lines. That is really weird. I would not expect this to be an issue with Custom Tabs, however, you cannot be sure.
You most likely use ProGuard for your final release. Maybe that causes some problem?

@kylethompson002
Copy link
Author

I finally found my issue. It was a stupid mistake on my part 🤦 . I had an intent filter for deep links that was intercepting the authenticate URL and not letting CustomTabs open. Thank you for the support.

@ThexXTURBOXx ThexXTURBOXx added invalid This doesn't seem right and removed bug Something isn't working labels Sep 20, 2022
@ThexXTURBOXx
Copy link
Owner

ThexXTURBOXx commented Sep 20, 2022

Okay, good to know for the future! Thank you very much for letting me know the solution! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants