[英]iOS SwiftUI - Google Sign-In error: Extra argument 'callback' in call
我得到了這個代碼:
func signIn(){
guard let presentingViewController = (UIApplication.shared.connectedScenes.first as? UIWindowScene)?.windows.first?.rootViewController else {return}
let signInConfig = GIDConfiguration.init(clientID: "xxxxx")
GIDSignIn.sharedInstance.signIn(
with: signInConfig,
presenting: presentingViewController,
callback: { user, error in
if let error = error {
self.errorMessage = "error: \(error.localizedDescription)"
}
self.checkStatus()
}
)
}
我收到錯誤“調用中的額外參數‘回調’”
在支架上
callback: { user, error in
請幫忙
你可以試試
GIDSignIn.sharedInstance.signIn(
with: signInConfig,
presenting: presentingViewController) { user, error in
if let error = error {
self.errorMessage = "error: \(error.localizedDescription)"
}
self.checkStatus()
}
請參閱文檔第4 節。添加 Google 登錄按鈕
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.