[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
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...
- Deep Linking & Password reset
I am using react native with expo. I want to implement deep link with the url recived via email. So when clicked the link it opens my app. I havent ever used de...
- Current User is Not authorized
recreating same Thread