[SOLVED] Getting a bug while redirecting to app after social auth in Flutter
- 0
- 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
- CORS error only on tables db api After u...
I've recently updated my self hosted appwrite instance to the 1.8.0 and updated my frontend with the tables db apis but strangely, even if I'm able to log in, g...
- Display an in-app in the user mobile?
Would it be possible to send a message that would display an in-app in the user mobile?
- Project stuck in read-only mode on free ...
Hi Appwrite team! I’m a student using the free plan, and my project (ID: 68e48f780001232ad879) is currently stuck in read-only mode. I can’t create or update ...