GIDSignIn.sharedInstance : sharedInstance not a function?

Viewed 2368

In this code, when I type GIDSignIn.sharedInstance, for some reason sharedInstance is not a function, which means I can't acces clientID. I cannot find a solution for this anywhere.

import UIKit
import GoogleSignIn


@main

class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
GIDSignIn.sharedInstance().clientID = "clientID"
        
          return true
    }
1 Answers

In latest version of GoogleSignIn SDK. Removed this method.

Now in new follow this link or below code. https://developers.google.com/identity/sign-in/ios/sign-in

@IBAction func clkLoginWithGmail(_ sender: UIButton) {
     let signInConfig = GIDConfiguration.init(clientID: "clientID-XYZ")
     GIDSignIn.sharedInstance.signIn(with: signInConfig, presenting: self) { user, error in

     }
}
Related