Back

Facing issues in Google SignIn with Swift SDK

  • 1
  • Apple
Drake
8 Sep, 2023, 04:07

This is the most important part for getting the redirect to work https://github.com/appwrite/sdk-for-apple/tree/1.1.0#registering-url-schemes.

Maybe clean and rebuild again?

TL;DR
The user is facing issues with Google SignIn using the Swift SDK. They mention that the `createOAuth2Session` function doesn't return anything. The suggestion is to run `account.get()` and if it throws an error, it means the user isn't logged in. The user is trying to integrate Google SignIn into their iOS app but is having trouble with the redirect URI. They have tried different approaches but are still facing the same issue. Another user suggests checking the URL schemes and cleaning and rebuilding the project. Potential Solution: Register the URL schemes correctly and try cleaning and rebuilding the project again.
rohanprasadofficial
8 Sep, 2023, 04:09

tried clean build still didn't work i download the apple playground and trying that now with my cred but didn't work as well.

Drake
8 Sep, 2023, 04:25

You sure the project id is correct?

rohanprasadofficial
8 Sep, 2023, 04:30

yes copied from app dashboard

rohanprasadofficial
8 Sep, 2023, 04:31

i thing i am trying understand it tried to open an app again and where does the uri of the app come from ?

Drake
8 Sep, 2023, 04:31

Huh?

rohanprasadofficial
8 Sep, 2023, 04:33

So thing is i first tried doing google sign in with my app named 'app' didn't work. then i tried download the apple appwrite playground then added all my cred and now when it redirects from the brower to my old 'app' not appwrite playground.

Drake
8 Sep, 2023, 04:34

It directs to whatever all has the plist set up...I don't totally know how apple handles if multiple apps register the same callback url scheme 🧐

rohanprasadofficial
8 Sep, 2023, 04:37

ok let me do one thing, let me don't do it on playground app, let me try it again on my app directly and post here the issues if any again.

rohanprasadofficial
8 Sep, 2023, 04:56

Still facing same, currently it redirects to correct app but

rohanprasadofficial
8 Sep, 2023, 04:58

got it it takes bundle it from appwrite when we register the projects and redirects to the same app uri

Drake
8 Sep, 2023, 05:25

Oh hmm. This is working as expected from Appwrite side...I'm not sure about this "open page in ..." Prompt

rohanprasadofficial
8 Sep, 2023, 05:29

just to confirm here, we create web the web app option only right ?

rohanprasadofficial
8 Sep, 2023, 05:34

ok seems something going wrong here 😢 struck for few days on this

Drake
8 Sep, 2023, 05:40

So what are you trying to achieve? Redirect without that open this page in ... Prompt?

rohanprasadofficial
8 Sep, 2023, 05:42

I wanted to integrate the google signin on my iOS app.

rohanprasadofficial
8 Sep, 2023, 05:42

But this is place it is struck something with missing redirect...

Drake
8 Sep, 2023, 05:45

That missing redirect uri is expected. There were improvements to that page in later versions

rohanprasadofficial
8 Sep, 2023, 05:56

But it doesn't complete the sign as well as sucess or failure on my app eventually

Drake
8 Sep, 2023, 06:53

So what happens when you tap open?

rohanprasadofficial
8 Sep, 2023, 20:44

it opens the same view again but doesn't return any value as well and does register as well user

Drake
8 Sep, 2023, 21:18

what's your code.

perhaps you're just logging in the same previous user

rohanprasadofficial
9 Sep, 2023, 09:45

let success = try account.createOAuth2Session( provider: "google" )

issue is it doesn't return any thing after than with which i can decide auth was sucess or not

safwan
9 Sep, 2023, 09:51

createOAuth2Session doesn't return anything. What you can do is run account.get() and if it throws an error it means the user isn't logged in

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