Open imwilliamxy opened 1 week ago
Your AndroidManifest.xml
contains <data android:scheme="ccom.company.appname"/>
(note the ccom
instead of com
).
Thank you for your reply. The error you pointed out was due to my typo. When submitting this issue, for privacy reasons, I replaced the actual schema with ccom.company.appname. In the real production environment, the scheme included in the AndroidManifest.xml and the callbackUrlScheme parameter in the login code are exactly the same. I can confirm this for sure.
Thank you again for your quick response.
Oh okay, sorry, should have known that...
Could you maybe try fixing the version of flutter_web_auth_2
to 4.0.0-alpha.5
or to 4.0.0-alpha.4
and report back?
It might be that either version 6 or 5 contains code that breaks some stuff on Android... Could also be an Android 14 issue, but I tought I had tested this before
I am experiencing the same issue. I made a short video of my setup, very basic app with a custom scheme configured. I've tried multiple versions of the 4.0.0-alpha.X, they all have the same behavior. I'm using Android API 34. I have tried with and without passing ephemeralIntentFlags
.
I don't know if this is the same issue, happy to open a separate one if needed.
@tmarkovski Thank you very much for the video - this is one of the most helpful bug reports I have ever received :) I will take a closer look at this. On the first button push it looked like it actually redirected to the app, but for some reason went back again (the small flicker indicates something like that)... Let's see
this is one of the most helpful bug reports I have ever received
You're welcome, it is also the fastest way to describe a problem.
That's correct, it seems like it navigates back, but the custom tab is still there. Either way, the app is launched correctly and the result is returned by the authenticate
function.
anyone figured this out? I'm having the same issue on android device, after login the activity screen does not go away
I'm sorry that I have not yet been able to look at it properly. I will update you once I had time to investigate
@ThexXTURBOXx Hi i am facing same issue after login the activity screen does not go away
@irfan512 I am aware of the issue :)
To add more information, it only happens on a physical Android device. On the emulator, it works without issue.
@joaquingrech on a physical Android device it not come back in app
I think I found the issue. Can you paste your androidmanifest? the launch mode of your main activity? It seems it must be set to singleTop. Mine was set to singleInstance and when I switched to singleTop it began working.
How's yours?
@joaquingrech Mine is also set to singleTop
and works fine - could indeed be the root of the problem!
I'm not sure why it would fail and I believe mine was set to singleInstance by some other plugin. In theory, that should not make this plugin fail unless it's creating multiple instances and overlapping each other. You may want to try with the different launch modes and see which ones work and which ones fail to add it to the documentation (or fix if possible).
@joaquingrech can you please paste your androidmanifest.
@irfan512 You have a different issue: You have not read flutter_web_auth_2
's setup instructions.
Description
After successfully logging into the app, the browser window cannot be closed properly on Android devices. According to the logs, the app has already obtained the accessToken. The same operation works perfectly on iOS.
Similar links are here. https://github.com/ThexXTURBOXx/flutter_web_auth_2/issues/106
according this thread, flutter_web_auth_2 was upgraded to version ^4.0.0-alpha.0
Minimal Reproduction
Steps to reproduce the behaviour:
Exception or Error
There's no error log
Expected Behaviour
The web browser should close and app should come into focus
Screenshots
No response
Additional context
flutter doctor -v [✓] Flutter (Channel stable, 3.22.1, on macOS 14.5 23F79 darwin-x64, locale en-US) • Flutter version 3.22.1 on channel stable at /Users/username/Documents/development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision a14f74ff3a (3 weeks ago), 2024-05-22 11:08:21 -0500 • Engine revision 55eae6864b • Dart version 3.4.1 • DevTools version 2.34.3
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/username/Documents/development/Android/sdk • Platform android-34-ext8, build-tools 34.0.0 • ANDROID_HOME = /Users/username/Documents/development/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d • CocoaPods version 1.15.2
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version unknown) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.90.0 ✗ Unable to determine VS Code version.
[!] Proxy Configuration • HTTP_PROXY is set ! NO_PROXY is not set
[✓] Connected device (4 available) • Pixel 6a (mobile) • codemasked • android-arm64 • Android 14 (API 34) • macOS (desktop) • macos • darwin-x64 • macOS 14.5 23F79 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.142
Device
pixel 6a
OS
Android 14
Browser
Chrome
Flutter version
Flutter version 3.22.1
flutter_web_auth_2 version
^4.0.0-alpha.0
Checklist