I have this code for registering and saving user data:
@objc func finishRegistering () {
guard let password = passwordTextField.text, isValidPassword(password) else {
presentCustomAlert(withTitle: LocalizedString.invalidPassword.translated, message: LocalizedString.passwordRules.translated)
return
}
Auth.auth().createUser(withEmail: email, password: password ) { [weak self] authResult, error in
if let error = error {
print(error)
return
}
guard let strongSelf = self, let authResult = authResult else { return }
strongSelf.saveUserDetails(firstname: strongSelf.firstName, lastname: strongSelf.lastName, userID: authResult.user.uid)
strongSelf.navigateToHomePage()
}
}
// MARK: - Saving user details to the database .
func saveUserDetails (firstname: String , lastname: String , userID: String ) {
let databaseReference = Database.database().reference()
let userReference = databaseReference.child("users").child(userID)
let userdetails = ["firstName": firstname , "lastName": lastname ]
userReference.setValue(userdetails) { error, _ in
if let error = error {
print("Erro saving user details " , error )
} else {
print("User details saved successfully")
}
}
}
I am getting this error:
Error Domain=FIRAuthErrorDomain Code=17999 "An internal error has occurred, print and inspect the error details for more information." UserInfo={FIRAuthErrorUserInfoNameKey=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information., NSUnderlyingError=0x600000d8d9b0 {Error Domain=FIRAuthInternalErrorDomain Code=3 "(null)" UserInfo={NSUnderlyingError=0x600000dbfde0 {Error Domain=com.google.HTTPStatus Code=400 "(null)" UserInfo={data={length = 220, bytes = 0x7b0a2020 22657272 6f72223a 207b0a20 ... 5d0a2020 7d0a7d0a }, data_content_type=application/json; charset=UTF-8}}, FIRAuthErrorUserInfoDeserializedResponseKey={
code = 400;
errors = (
{
domain = global;
message = "CONFIGURATION_NOT_FOUND";
reason = invalid;
}
);
message = "CONFIGURATION_NOT_FOUND";
}}}}
I tried updating firebase iOS sdk to latest version , downloaded new google plist and added that , tried cleaning build folder and packages and nothing works. How i can fix this error