Skip to content
Back

Flutter OAuth Google Login – Redirect Issue on Android

  • 0
  • Flutter
  • Auth
Gaurav kumar
9 Aug, 2025, 11:12

Description: I’m using Appwrite with Flutter for Google OAuth login. The authentication flow works fine on iOS and the browser, but on Android devices, after a successful Google sign-in, the redirection back to the app is not working as expected.

Details:

Platform: Flutter (latest), Appwrite SDK (latest)

Login Method: account.createOAuth2Session(provider: 'google',) Behavior on iOS: Works correctly, user is redirected back to the app and the session is created. Behavior on Android: Google login succeeds, but after consent, the redirect does not return to the app. Instead, it either hangs or stays on the browser. Expected Behavior: On success, the user should be redirected back to the app with the session established.

Tried:

  1. Updated AndroidManifest intent filter for redirect URL.
  • <!-- Add this inside the <application> tag, along side the existing <activity> tags --> <activity android:exported="true" android:name="com.linusu.flutter_web_auth_2.CallbackActivity" > <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-<PROJECT_ID>" /> </intent-filter> </activity>*
  1. Ensured redirect URL matches in Appwrite console and app config.
  2. Looking for guidance or examples on fixing the Android OAuth redirection issue for Appwrite + Flutter.
TL;DR
Developers facing Android redirection issue with Flutter OAuth Google Login via Appwrite. Works on iOS, but on Android, redirection back to app after Google sign-in not functioning correctly. Tried updating AndroidManifest, matching redirect URLs, seeking guidance on fixing the issue.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more