gpt4 book ai didi

swift - FirebaseUI 不显示任何输入字段或按钮

转载 作者:行者123 更新时间:2023-11-30 10:37:05 27 4
gpt4 key购买 nike

我想在我的项目中实现 FirebaseUI,但登录页面未显示任何输入字段或按钮:

FUIAuth

显示FUIAuth的代码:

@IBAction func logInButtonTapped(_ sender: Any) {

let authUI = FUIAuth.defaultAuthUI()

guard authUI != nil else {
//Log error

return
}

authUI?.delegate = self
authUI?.providers = [FUIEmailAuth]()

let authViewController = authUI!.authViewController()

present(authViewController, animated: true, completion: nil)

}

}

extension LogInViewController: FUIAuthDelegate {

func authUI(_ authUI: FUIAuth, didSignInWith authDataResult: AuthDataResult?, error: Error?) {

if error != nil {

return
}

performSegue(withIdentifier: "ToHomeVCSegue", sender: self)
}
}

我在 podfile 中尝试了很多不同的选项:

pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'FirebaseUI'
pod 'FirebaseUI/Email'

最佳答案

我刚刚遇到了同样的问题,似乎所有示例都缺少使提供程序出现所需的步骤的某些方面。第一个答案是正确的,但没有举例。在下面的代码中,我只是起诉电子邮件和 Google 身份验证。此代码嵌入在登录按钮按下事件中。

let authUI = FUIAuth.defaultAuthUI()

guard authUI != nil else {
print("authUI error")
return
}
authUI?.delegate = self
let providers: [FUIAuthProvider] = [
FUIEmailAuth(),
FUIGoogleAuth()
]
authUI?.providers = providers
let authViewController = authUI!.authViewController()
present(authViewController, animated: true)

关于swift - FirebaseUI 不显示任何输入字段或按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57743616/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com