[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
- executeFunction intermittently throws Fo...
Environment: Flutter app using the Appwrite Flutter SDK, calling executeFunction for [describe endpoint, e.g. live-stream-related function]. *Description*: Int...
- How to update from 1.8.1 to 1.9.6
Due to the number of issues reported in version 1.9.5, I am hesitant to proceed with the update. Could anyone advise if version 1.9.6 is stable and resolves tho...
- HTTP Error 500 ''
Hello to everyone, I'm a Flutter developer and actually I'm developing an app using Appwrite.. during my tests and also massive ones I've noticed something we...