I have been a while without touching Firebase
and just got back to it for a new iOS project.
I am using Xcode 10.0 and iOS 12.0.1.
Here is an issue I have. For testing purpose I have chosen these DB rules:
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write;
}
}
}
And my swift code for writing data to the Firebase DB is as follow:
// reference is of type DatabaseReference, dataDico is of type [String : Any]
reference.setValue(dataDico) {
(error, ref) -> Void in
if error == nil {
print("All was OK !!!")
return
}
if error!.localizedDescription == "Permission denied" {
print("Permission has been denied !!")
return
}
print("We were not able to do the job (for some reason) !\n\(error)")
}
Strangely enough I always get the message: Permission has been denied !!
Anyone can point out what I am missing here?