Saturday, July 20, 2024
HomeiOS Developmentswift - iOS Firestore permission denied even when utilizing Firebase Authentication

swift – iOS Firestore permission denied even when utilizing Firebase Authentication


I do know this query has been requested quite a bit however plenty of the options say to alter the Firestore guidelines and I do not need to do this. I am questioning why they don’t seem to be working as is since I’ve authentication arrange by way of Firebase.

I’ve arrange Firebase authentication by including GoogleService-Information.plist to my undertaking and calling `FirebaseApp.configure() on launch. I will login customers with out concern, however now when I attempt to learn or write to a set in Firestore I get an “Lacking or inadequate permissions” error.

These are my Firestore guidelines:

service cloud.firestore {  
  match /databases/{database}/paperwork {
    match /{doc=**} {
      permit learn, write: if request.auth != null;
    }
  }
}

That is the operate I am operating so as to add to the Firestore:

    func add_data() async {
        Job {
            do {
                if let person = Auth.auth().currentUser {
                    Firestore.firestore().assortment("assortment/customers/take a look at).addDocument(knowledge: ["Title" : "TEST"])
                }
            }
            catch {
                print(error)
            }
        }

    }

Unsure what else I can do to make sure there are ample permissions, and I do not need to change the principles to permit anybody to learn/write.

Thanks!



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments