简体   繁体   中英

Cannot find type GIDSignInDelegate in scope

As you see in the below, I am getting these errors, I have installed Firebase and GoogleSignIn, what am I doing wrong?

在此处输入图像描述

As pointed out by Chris in the comments, follow the migration guide to update to GoogleSignIn 6.x.

See also this example of migrating the Firebase Auth QuickStart.

If you are using latest GoogleSignIn sdk use this below code on button action

        let signInConfig = GIDConfiguration.init(clientID: KGoogle.clientID)

    GIDSignIn.sharedInstance.signIn(with: signInConfig, presenting: self) { user, error in
        guard error == nil else { return }
        guard let user = user else { return }

        if let profiledata = user.profile {
            
            let userId : String = user.userID ?? ""
            let givenName : String = profiledata.givenName ?? ""
            let familyName : String = profiledata.familyName ?? ""
            let email : String = profiledata.email
            
            if let imgurl = user.profile?.imageURL(withDimension: 100) {
                let absoluteurl : String = imgurl.absoluteString
                //HERE CALL YOUR SERVER API
            }
        }
        
    }

pod 'GoogleSignIn', '~> 5.0.2'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM