我正在将 Sign in with Google 与 iOS Firebase SDK 集成。当用户点击 GIDSignIn
按钮时,应用程序会显示一条警告,显示 “MyAPP”想要使用 Google.com 登录
,但警告很快就会消失。我在 didSignInFor user: GIDGoogleUser
方法中得到的错误如下:
2019-02-21 16:54:13.104279+0530 MyApp[18743:185089] [Warning] Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior (<SFAuthenticationViewController: 0x7fa327945800>)
[DEBUG] Google sign-in error: Error Domain=com.google.GIDSignIn Code=-5 "The user canceled the sign-in flow." UserInfo={NSLocalizedDescription=The user canceled the sign-in flow.}
我已经关注了 Authenticate Using Google Sign-In on iOS文档。
我也在 Google Sign-In crashes on iOS 9 attempting to call canOpenURL 尝试了答案, 但它不起作用。
AppDelegate
也实现了 GIDSignInUIDelegate
。
如果我将按钮从 GIDSignInButton
to UIButton
更改为, 它有效,但风格丢失了。
最佳答案
我之前也遇到过这个问题。 GIDSignInButton
对象在代码中不需要addTarget
或链接@IBAction
。 GIDSignInButton
类已经为我们处理了该操作。
关于ios - 如何在 iOS 上使用 Sign In with Google 修复 `The user canceled the sign-in flow.`?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54806794/