I'm trying to get data from my firestore database. I did the following:
Firestore.instance.collection('highScore').document('gGSIHVzDIjX1UCq7Pk8q').get().then((DocumentSnapshot ds) {
print(ds);
});
I get the following error when this line is run: PERMISSION_DENIED: Missing or insufficient permissions.
I tried modifying the firestore rules to:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, update, delete: if request.auth.uid == resource.data.uid;
allow create: if request.auth.uid != null;
}
}
}
But I still get the same error. What am I doing wrong and how can I fix it?