Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of undeclared type 'GIDSignInUIDelegate' when changing GoogleSignIn pod version

Problem when changing pod version of GoogleSignIn from previous versions to v5.0.0.

like image 207
hecroge Avatar asked Sep 19 '19 08:09

hecroge


3 Answers

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

like image 140
petrsyn Avatar answered Nov 16 '22 13:11

petrsyn


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

like image 1
Niraj Avatar answered Nov 16 '22 13:11

Niraj


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

like image 18
hecroge Avatar answered Nov 16 '22 15:11

hecroge