I am trying to build an app that contains chat, but the error message appears:
[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: [cloud_firestore/permission-denied] The caller does not have permission to execute the specified operation.
My firebase rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{uid}{
allow write: if request.auth != null && request.auth.uid == uid;
}
match /users/{uid}{
allow read: if request.auth != null;
}
match /chat/{document=**}{
allow read: if request.auth != null;
}
}
}
as seen in the picture above, when I write a message and send it, it doesn't appear in the screen, and the error message is written in terminal