Problem when changing pod version of GoogleSignIn from previous versions to v5.0.0.
The GIDSignInUIDelegate
protocol used to be necessary to be implemented in the UIViewController which initiated GIDSignIn.sharedInstance().signIn()
. That UIViewController had to register itself using the GIDSignIn.sharedInstance().uiDelegate = self
.
Since the GoogleSignIn 5.0.0 this has changed. The UIViewController which initiates the GIDSignIn.sharedInstance().signIn()
should register itself using the GIDSignIn.sharedInstance()?.presentingViewController = self
and apparently no longer needs to implement the GIDSignInUIDelegate
which no longer exists.
The GIDSignInDelegate
is still intended to be implemented typically in the AppDelegate which should register itself using GIDSignIn.sharedInstance().delegate = self
.
Please see also: https://developers.google.com/identity/sign-in/ios/quick-migration-guide
No need to use GIDSignInUIDelegate
, check this link for migration guide: https://developers.google.com/identity/sign-in/ios/quick-migration-guide#migrating_from_versions_prior_to_v500
Just use GIDSignInDelegate
and replace GIDSignIn.sharedInstance().uiDelegate = self
with GIDSignIn.sharedInstance()?.presentingViewController = self
and
GIDSignIn.sharedInstance().handle(url,
sourceApplication: sourceApplication,
annotation: annotation)
with GIDSignIn.sharedInstance().handle(url)
This was where my app was getting rejected for UIWebView
You have to change GIDSignInUIDelegate
to GIDSignInDelegate
as the example in GoogleSignIn documentation:
https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift
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