小编bad*_*icy的帖子

无法获取默认 Firebase 数据库实例。必须调用`[FIRApp配置]

当我尝试向 Firebase 验证用户时,没问题,但是当我尝试写入数据库用户的电子邮件地址时,出现错误。

我的代码:

import UIKit
import Firebase

class ViewController: UIViewController {

    @IBOutlet weak var emailField: UITextField!
    @IBOutlet weak var sifreField: UITextField!
    @IBOutlet weak var sifre1Field: UITextField!

    var ref = Database.database().reference()

    override func viewDidLoad() {
        super.viewDidLoad()
        // 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.
    }

    @IBAction func kayitBtn(_ sender: Any)
    {
        if(sifreField.text != sifre1Field.text)
        {
            print("****error****")
        }
        else if ( …
Run Code Online (Sandbox Code Playgroud)

firebase swift firebase-realtime-database

4
推荐指数
1
解决办法
2932
查看次数