I have integrated the GoogleSinIn API
in my project with Swift 4.0
. It is working on iOS 11.0
but when I'm testing the same on iOS 10.0
it is opening the Google
login page on the Safari
browser or the device and after signing successfully it is opening the Google
search page.
When I click the GoogleSignIn
button shown below it opens the browser shown in next image.
Then I fill up the credentials.
After the successful signed in, It redirects to the Google
page instead of the application page.
Update your device to the latest version of iOS or iPadOS. You can update your device wirelessly by going to Settings > General > Software Update and if there is an update, follow the onscreen instructions to update your device. Clear the history, cache and cookies to see if this fixes your problem.
You have to implement this delegate function in your AppDelegate
.
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
return GIDSignIn.sharedInstance().handle(url as URL!, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplicationOpenURLOptionsKey.annotation])
}
check your GIDSignInUIDelegate
, don't forget
func sign(_ signIn: GIDSignIn!, present viewController: UIViewController!) {
self.present(viewController, animated: true, completion: nil)
}
func sign(_ signIn: GIDSignIn!, dismiss viewController: UIViewController!) {
self.dismiss(animated: true, completion: nil)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With