Closed kylethompson002 closed 2 years ago
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?
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.
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?
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.
Okay, good to know for the future! Thank you very much for letting me know the solution! :)
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.
how to fix?
how to fix?
Look through all your intent filters (and all the ones from the package you are depending on - they might also be the cause of the problem) and remove the ones which interfere with flutter_web_auth_2
's intent filter
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.
your redirect_url is https scheme or custom url? can you show me the AndroidMainfest.xml and you redirect_url?
What if I want to set up both deep linking (so the user can click a link from somewhere else and it opens my app) and the callback URL? Based on this solution it feels like I can't do both because my deep link will just be intercepting my callback URL?
Describe the bug
When I make the call to
FlutterWebAuth2.authenticate
, the web view does not open, and it immediately returnsPlatformException(CANCELED, User canceled login, null, null)
.To Reproduce
Steps to reproduce the behavior:
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!)
flutter_web_auth_2
version: 1.1.2Additional 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).