Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Sign in fails on iOS 13 GM

My app has a Sign in with Google button. When I try to sign in on iOS 13.0 GM GIDSignInDelegate didSignInForUser:WithError: returns this error:

Error Domain=com.google.GIDSignIn Code=-1 "The operation couldn’t be completed. (org.openid.appauth.general error -3.)"

I have no clue how to fix this issue. I'm using Google Sign In 5.0.0 as part of Firebase 6.8.1.

like image 696
Vladimir Grigorov Avatar asked Sep 12 '19 12:09

Vladimir Grigorov


4 Answers

Following is the solution for successfully having the login view. Call the signin method after the ViewController's view is appeared, it will not be dismissed programatically. I have just implemented in IOS 13 and it works fine.

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    GIDSignIn.sharedInstance()?.delegate = self
    GIDSignIn.sharedInstance()?.presentingViewController = self
    GIDSignIn.sharedInstance()?.scopes = [kGTLRAuthScopeDrive]
    GIDSignIn.sharedInstance()?.prepareForInterfaceBuilder()
    GIDSignIn.sharedInstance()?.signIn()
}
like image 43
Nafisha Mamti Avatar answered Nov 12 '22 11:11

Nafisha Mamti


I figured it out! The AppAuth-iOS, which is a open-source dependency of GoogleSignIn SDK, has been updated from 1.1.0 to 1.2.0 in August, including this iOS 13 support. So you need to run pod update GoogleSignIn to update the AppAuth to 1.2.0. The GoogleSignIn SDK itself hasn't been updated since 5.0.0, so that got me confused.

like image 102
Sean Choe Avatar answered Nov 12 '22 11:11

Sean Choe


I downloaded the Firebase 6.9.0 SDK zip and experienced this same issue. The README indicated that the bundled version of AppAuth was 1.2.0. I was able to resolve it by updating AppAuth to the master version.

Specifically, I removed the AppAuth framework included with Firebase, and instead build AppAuth using Carthage.

like image 2
Matt Comi Avatar answered Nov 12 '22 10:11

Matt Comi


For future reference when other users find this question:

Google fixed this issue in GoogleSignIn v5.0.1. When updating your app to iOS 13, you'll likely have to update the GoogleSignIn SDK as well.

like image 1
throwaway390384085 Avatar answered Nov 12 '22 11:11

throwaway390384085