I am just getting started working with Firebase, so I connected a test login/reg app (named RealLogin) to a database and everything was looking great, super easy, worked great.
Now I am incorporating this into another application, but when i try and set the referenceFromURL, it still tells me it is expecting the RealLogin database URL. I have since deleted the RealLogin xCode files and all Firebase connections, but its still wants that original database url..
Here is my code:
@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!)
}
})
})
}
And here is the error I am getting upon clicking the Register button:
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'