Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS/Firebase希望连接到不再存在的旧数据库,不允许我更改引用_Ios_Firebase_Swift3_Firebase Realtime Database_Firebase Authentication - Fatal编程技术网

iOS/Firebase希望连接到不再存在的旧数据库,不允许我更改引用

iOS/Firebase希望连接到不再存在的旧数据库,不允许我更改引用,ios,firebase,swift3,firebase-realtime-database,firebase-authentication,Ios,Firebase,Swift3,Firebase Realtime Database,Firebase Authentication,我刚刚开始使用Firebase,所以我将一个测试登录/reg应用程序(名为RealLogin)连接到一个数据库,一切看起来都很棒,超级简单,工作非常好 现在我将它合并到另一个应用程序中,但是当我尝试设置referenceFromURL时,它仍然告诉我它需要RealLogin数据库URL。我已经删除了RealLogin xCode文件和所有Firebase连接,但它仍然需要原始的数据库url 这是我的密码: @IBAction func registerButtonPressed(_ sender

我刚刚开始使用Firebase,所以我将一个测试登录/reg应用程序(名为RealLogin)连接到一个数据库,一切看起来都很棒,超级简单,工作非常好

现在我将它合并到另一个应用程序中,但是当我尝试设置referenceFromURL时,它仍然告诉我它需要RealLogin数据库URL。我已经删除了RealLogin xCode文件和所有Firebase连接,但它仍然需要原始的数据库url

这是我的密码:

@IBAction func registerButtonPressed(_ sender: UIButton) {

    FIRAuth.auth()?.createUser(withEmail: emailTextField.text!, password: passwordTextField.text!, completion: { (user, error) in
        if error != nil {
            print(error!)
        }

        let ref = FIRDatabase.database().reference(fromURL: "https://intentiontracker.firebaseio.com")
        let userReference = ref.child("users")
        let values = ["name": self.nameTextField.text, "email": self.emailTextField.text]

        userReference.updateChildValues(values, withCompletionBlock: { (err, ref) in
            if err != nil {
                print(err!)
            }
        })
    })

}
下面是我在点击注册按钮时遇到的错误:

Terminating app due to uncaught exception 'InvalidDatabaseURL', reason: 'Invalid URL (https://intentiontracker.firebaseio.com) passed to getReference(). URL was expected to match configured Database URL: https://reallogin-d047d.firebaseio.com'

这些都是添加到项目和包名中的Google服务信息文件。
您应该使用包名配置Firebase项目,下载GoogleService信息文件并将其添加到项目中。然后您应该可以了,它应该可以工作。

这有点奇怪,因为您的FIRDatabase是通过AppDelegate中的FIRApp.configure()配置的(通常)。检查您的Google服务信息文件-数据库URL键,因为Firebase将(应该)使用该键连接到URL。哦,你可以在控制台中将你的新应用程序添加到你的Firebase数据库,并生成一个新的信息文件。你好!请将答案标记为正确,因为它解决了您的问题。请将我的答案标记为正确:D您也可以向上箭头:D很乐意帮助。@MagoNicolasPalacios您能帮我回答这个问题吗?