2

New to Firebase and iOS. I was wondering how to redirect to another screen, not the same screen it logged in from after a user signs in with Google.

@available(iOS 9.0, *)
func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any])
    -> Bool {
        return GIDSignIn.sharedInstance().handle(url,
                                                 sourceApplication:options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String,
                                                 annotation: [:])
    }
}
a123
  • 49
  • 7

1 Answers1

2

https://stackoverflow.com/a/20690072/7408005

And then

added this to this to the view controller the button was in:

func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
    if error != nil
    {
        print("Google Sign In Error")
    }
    else
    {
        self.performSegue(withIdentifier: "toHomeScreen", sender: self)
    }

}
a123
  • 49
  • 7