[SOLVED] Getting a bug while redirecting to app after social auth in Flutter
- 0
- Resolved
- Android
- Flutter
- Accounts
Appwrite is showing a weird behavior after redirecting from social auth. It is giving me option to pick an app rather than auto redirecting to the app. Here is my android manifest code; <activity android:name="com.linusu.flutter_web_auth_2.CallbackActivity"
android:exported="true">
<intent-filter android:label="flutter_web_auth_2">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="appwrite-callback-65181fc368c9ae7e585l" />
</intent-filter>
</activity> Kindly have a look into it why its behaving like this. In Actual case it should auto redirect to the app.
This happens because you have two apps with the same url scheme configured so Android doesn't know which app to redirect to
How about you delete the playground app?
@Steven yes now app is getting redireted properly but creating another problem: after calling createOAuth function i am getting this exception: Exception has occurred.
_TypeError (type 'Null' is not a subtype of type 'List<dynamic>') my code for createOAuth2Session is ```Future<void> logInWithGoogle() async {
try {
await _accountProvider.createOAuth2Session(
provider: 'google',
);
_getAccount();
} on AppwriteException catch (_) {
rethrow;
} catch (error, stackTrace) {
Error.throwWithStackTrace(LogInWithGoogleFailure(error), stackTrace);
}
} and my _getAccount() code is as follows: _getAccount() async {
try {
final user = await _accountProvider.get();
if (user.email.isEmpty) {
print('user email is empty');
} else {
print('user email is not empty');
}
} on AppwriteException catch (error) {
print(error.message);
}
}``` Exception is being caught while calling _getAccount() function
What version of the Appwrite Flutter SDK are you using and what version of Appwrite are you on?
@Steven appwrite flutter sdk -> appwrite: ^11.0.0 while appwrite self hosted Version 1.3.8
That SDK version is not compatible with the version of Appwrite you are on. Downgrade and read the readme
@Steven Yes it solved the problem. But i have a concern what if i have two apps in the same project, then how can I avoid app selection issue while redirecting from social auth.?
That's a limitation at the moment
@Steven Ohhh, are there any plans to remove this limitation in near future?
No plans at the moment. I think this is the related issue: https://github.com/appwrite/appwrite/issues/1515
Make sure you π it
[SOLVED] Getting a bug while redirecting to app after social auth in Flutter
Recommended threads
- How to disable appwrite/embedding from s...
Hi everyone! I'm currently running a self-hosted instance of Appwrite. For my current use case, I don't need the AI/embedding features, and I noticed the `app...
- Active Running Project Deletion Alert Em...
Hi , I received an email alert from Appwrite today stating βyour project will be deleted within 14 days if no action is taken,β though I have been actively usin...
- Appwrite rejecting create and edit reque...
hello, so my issue is that when i make a debug build of my app, everything works as it should, but when i download and test a SIGNED release database rejects al...