-
Notifications
You must be signed in to change notification settings - Fork 71
Description
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.
final result = await FlutterWebAuth2.authenticate(url: authUrl.toString(), callbackUrlScheme: "com.company.appname", options: const FlutterWebAuth2Options(intentFlags: ephemeralIntentFlags));
Similar links are here.
#106
according this thread, flutter_web_auth_2 was upgraded to version ^4.0.0-alpha.0
Minimal Reproduction
Steps to reproduce the behaviour:
- Use the following code:
final result = await FlutterWebAuth2.authenticate(url: authUrl.toString(), callbackUrlScheme: "com.company.appname", options: const FlutterWebAuth2Options(intentFlags: ephemeralIntentFlags));
- The following code was added to AndroidManifest.xml
<activity
android:name="com.linusu.flutter_web_auth_2.CallbackActivity"
android:exported="true">
<intent-filter android:label="App Login">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="ccom.company.appname"/>
</intent-filter>
</activity>
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
- I have read and followed the entire troubleshooting guide and it has not provided the solution I need.
- I have provided all the information I can.