Closed maysamsh closed 1 year ago
Simply use a different scheme for either your deep links or flutter_web_auth. Yeah, it's more work to maintain another scheme but that's the workaround.
I stuck with this issue. Does everyone have any solutions?
@vinhhoangdo do you happen to have appAuthRedirectScheme
defined with the same scheme name in manifestPlaceholders
(build.gradle
)? If not, what does your AndroidManifest.xml
look like? Do you have two or more intents with the same <data android:scheme=<scheme> />
?
Yeah thank dude @bartcone-fulfilld, I will check the scheme name in manifestPlaceholders
. In the AndroidManifest.xml
:
For this, I defined some intents like:
<application>
.....
<activity >
.......
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myScheme" />
</intent-filter>
</activity>
<activity android:name="com.linusu.flutter_web_auth.CallbackActivity">
<intent-filter android:label="flutter_web_auth">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myScheme" />
<data android:host="login" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
And now, If I install the app and click on the Login button, it will show the dialog with two options!
I will update more info about manifestPlaceholders (build.gradle)
..!
Thank you!
Hi @bartcone-fulfilld, I am back to work and checking the manifestPlaceholders
. So it does not define in the build.gradle
. Could you tell me what am I supposed to do now man?
@vinhhoangdo you have two <data android:scheme="myScheme" />
in that manifest file. Make them different and then try (by different I mean change the myScheme
part).
@bartcone-fulfilld yeah, I see. Is there any way to keep both schemes the same? Or both of them should differ from each other.
@vinhhoangdo the schemes need to be different in order for the setup to work, since the callback must open the flutter_web_auth
activity in order to receive the callback. I would suggest appending something like -auth
to your callback scheme for the authentication.
Please also see the new troubleshooting section of the readme: https://github.com/LinusU/flutter_web_auth#troubleshooting
Let me know if you are still having problem!
My app supports deep links and also uses this package for web auth. there is a confusing action sheet shown to the user before opening the browser:
This is my intent:
Is there any way to open the browser right away instead of showing this confusing UI?