Firebase database setValue: or removeValue failed: iOS enabled

I am trying to write data to a Firebase database, but I get the following error when I click on my saved button.

2016-12-02 11: 09: 42.548 StartupNow [1482: 60415] [FirebaseDatabase] setValue: or removeValue: in / test / -KY-VpLZWbp4vjF3BpMk failed with the error: mission_denied

Things I tried: I made sure that my .read and .write rules were set to true in my console, reconnected my saveButtonPressed button, wrote the Firebase link to the function, and called it in my saveButtonPressed () method.

Additional resource Here is a tutorial that I am following. https://youtu.be/F42CzqIBxHQ?t=4m14s

var ref: FIRDatabaseReference?

override func viewDidLoad() {
    super.viewDidLoad()

    ref = FIRDatabase.database().reference()

}

@IBAction func saveButtonPressed() {
   // TODO: Post data to Firebase

    firebaseChild()
    print("********************************")
    print("********************************")

}

func firebaseChild () {
    ref?.child("Test").childByAutoId().setValue("Hello Firebase")

}
+5
5

FreddieOh Slack, , , GoogleService-info.plist, , . (, Firebase, plist.)

, , , GoogleService-info.plist DATABASE_URL. Firebase , , URL-, , plist.

, - , , , "". ... , - .:)

+8

. / . , .

: !

{
  "rules": {
    ".read": true,
    ".write": true
  }
}

Firestore

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write;
    }
  }
}
+15

Firebase , .

, . . .

: https://youtu.be/FcQCPqckvqo

enter image description here

+8

. ,

fireBase β†’ β†’ β†’ (" ") β†’ make both

{  
    "rules": {
        ".read": true,
        ".write": true
    }

enter image description here

enter image description here

+2

, . enter image description here

0

Source: https://habr.com/ru/post/1662673/


All Articles