My custom code
changed(){
let reference = db.collection('messages').orderBy('timestamp')
// listen for changes to the 'messages' collection
reference.onSnapshot(snapshot => {
snapshot.docChanges().forEach(change => {
if(change.type == 'added'){
let document = change.doc
this.messages.push({
id: document.id,
name: document.data().name,
content: document.data().content,
timestamp: moment(document.data().timestamp).format('lll')
})
}
})
})
My guidelines for firebase:
service cloud.firestore { match /databases/{database}/documents {
match /messages/{document=**} {
allow read, update, delete, if request.auth.uid == resource.data.uid;
allow create: if request.auth.uid != null;
}
}}
My issue
Uncaught Error in onSnapshot: FirebaseError: Missing or insufficient permissions.
assistance in resolving this issue would be appreciated