“GIDSignIn”类型的值没有成员“signInSilently”

iPh*_*e 7 2 iphone google-calendar-api ios gidsignin swift5

这是什么错误,请指导到目前为止在谷歌上找不到任何材料。下面是我的代码,它给出了错误:

if GIDSignIn.sharedInstance().hasAuthInKeychain() == false {
               GIDSignIn.sharedInstance().signIn()
           } else {
               if let user = GIDSignIn.sharedInstance().currentUser {
                   service.authorizer = user.authentication.fetcherAuthorizer()
                   fetchEvents()
               } else {
                   GIDSignIn.sharedInstance().signInSilently()
               }
           }
Run Code Online (Sandbox Code Playgroud)

出现两个错误:

Value of type 'GIDSignIn' has no member 'hasAuthInKeychain'
Value of type 'GIDSignIn' has no member 'signInSilently'
Run Code Online (Sandbox Code Playgroud)

小智 5

请检查GIDSignIn您正在使用的版本。从v5.0.0

signInSilently已替换为restorePreviousSignIn.

hasAuthInKeychain已替换为hasPreviousSignIn.

参考: https: //developers.google.com/identity/sign-in/ios/release