I am learning the google sign-in to app with GoogleSignIn SDK (Installed with cocoapods). I did not specify version in pod file, its automatically installed GoogleSignIn (4.4.0). Going Through the documentation here. According to documentation, To add sign in button we have to write
GIDSignIn.sharedInstance()?.presentingViewController = self
// Automatically sign in the user.
GIDSignIn.sharedInstance()?.restorePreviousSignIn()
but in latest Xcode Version 10.3 (10G8) i am getting error
Value of type 'GIDSignIn' has no member 'presentingViewController'
Value of type 'GIDSignIn' has no member 'restorePreviousSignIn'
I tried to search about the updated version for this but unfortunately not found. Kindly help me out to integrate GoogleSignIn
Your code is correct if you are using Google Sign-In v5.0:
GIDSignIn.sharedInstance()?.presentingViewController = self
But since you've installed 4.4.0, you should accept Vitaly Shpinyov's answer.
pod 'GoogleSignIn', '~> 5.0'
In viewDidLoad()
of your ViewController
add the following line:
GIDSignIn.sharedInstance()?.uiDelegate = self
and make the ViewController
conform to GIDSignInUIDelegate
protocol.
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