我是iOS开发的新手。我想实现Firebase不礼貌的用户界面
这是我的 ViewController 文件
import UIKit
import Firebase
import FirebaseCore
import FirebaseAuth
import FirebaseUI
import FirebaseFirestore
class ViewController: UIViewController{
//let authUI = FUIAuth.defaultAuthUI()
//let authui = FirebaseApp.configure()
override func viewDidLoad() {
super.viewDidLoad()
// FirebaseApp.configure()
if FirebaseApp.app() == nil {
FirebaseApp.configure()
}
print("came inside viewdialoadds")
// logiin()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
print("came inside parttwoooooooooooo")
}
@IBAction func loginfunction(_: UIButton) {
print("Tappeddddddddddddddddddddd")
logiin()
}
func logiin() {
print("login called")
if FirebaseApp.app() == nil {
print("login called firebase now confieeddd")
FirebaseApp.configure()
}
// FirebaseApp.configure()
print("login called firebase UI confieeddd")
let authUI = FUIAuth.defaultAuthUI()
// You need to adopt a FUIAuthDelegate protocol to receive callback
authUI?.delegate = self as? FUIAuthDelegate
// authUI.delegate = self
let providers: [FUIAuthProvider] = [
FUIGoogleAuth(),
FUIPhoneAuth(authUI:FUIAuth.defaultAuthUI()!),
]
self.authUI.providers = providers
func application(_ app: UIApplication, open url: URL,
options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
let sourceApplication = options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String?
if FUIAuth.defaultAuthUI()?.handleOpen(url, sourceApplication: sourceApplication) ?? false {
return true
}
// other URL handling goes here.
return false
}
}
我遇到编译时错误,请在下面添加屏幕截图,请查看
任何人都请指定我的代码有什么问题。...我在https://firebase.google.com/docs/auth/ios/firebaseui?authuser=0此处找到了文档