Back

Google Auth Flutter

  • 0
  • Android
  • Flutter
Vatsal Gajjar
1 Jun, 2023, 06:33

I am currently trying to implement the google authentication in my Flutter App but when you choose an account the app stops and its not able to login

I have written this code in my AndroidManifest :-

<activity android:name="io.appwrite.views.CallbackActivity" android:exported="true"> <intent-filter android:label="android_web_auth"> <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>

Kindly help if you know anything about this

TL;DR
The user is having trouble implementing Google authentication in their Flutter app. The app stops and is unable to login. Some suggestions and solutions provided by others in the thread include: - Clean and rebuild the app after making changes. - Add a `WEB` platform in the Google Cloud Console. - Make sure to add the redirect URI in the Google Cloud Console. - Add test emails in the Google Cloud Console for development. - Check if the `[PROJECT_ID]` in the AndroidManifest has been replaced with the actual project ID. - Share a photo of the Appwrite console setup and Flutter code for further assistance. Solution: Check if the necessary
RohitRanjan
1 Jun, 2023, 06:34
<data android:scheme="appwrite-callback-[PROJECT_ID]" />

I hope you replaced the [PROJECT_ID] with your actual project id

Vatsal Gajjar
1 Jun, 2023, 06:39

yes I did

Vatsal Gajjar
1 Jun, 2023, 06:39

but even after that its not working

RohitRanjan
1 Jun, 2023, 06:40

If you can share your Appwrite console photo of Setting up google signIn & Flutter code, I can help you out

Vatsal Gajjar
1 Jun, 2023, 06:48
Vatsal Gajjar
1 Jun, 2023, 06:49

here you go

RohitRanjan
1 Jun, 2023, 06:54

In your google cloud console, you're required to add some test emails in development. Add the emails there and try signin again

RohitRanjan
1 Jun, 2023, 06:54

Also make sure to add this redirect URI

Vatsal Gajjar
1 Jun, 2023, 06:57

what to add in redirect URI

Vatsal Gajjar
1 Jun, 2023, 06:57

i have already added the test emails

RohitRanjan
1 Jun, 2023, 06:58

Scroll down and you will find the redirect uri

D5
1 Jun, 2023, 07:07

Also remember adding this as web in the Google cloud panel, instead of as Android

safwan
1 Jun, 2023, 07:15

Just to extend on this point -

When you use Google OAuth in your flutter x appwrite project, always add a WEB platform on your Google Cloud Console. If you've used oauth with appwrite before, you might have noticed that the oauth flow takes place in a browser, and not directly in your app. This is why you need to make sure to add a WEB platform to your GCP.

RohitRanjan
1 Jun, 2023, 07:16

https://github.com/appwrite/docs/pull/369

It's about to get added in the docs

Drake
1 Jun, 2023, 19:31

make sure to clean and rebuild after

Drake
1 Jun, 2023, 19:31

it would help if you clarified this:

app stops and its not able to login

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