Building an app, using Firestore database for its content.
Rules are:
service cloud.firestore {
match /databases/{database}/documents {
// Allow public read access, but only content owners can write
match /{document=**} {
allow read: if true
allow write: if request.auth.uid == request.resource.data.author_uid
}
}
}
As the warning says, I have allow read just set to true
, which I understand, is a problem.
How do I make it so my Flutter app can read the contents of my Firestore database, but any random user can't? The app is public/free...etc, so I don't want people to have to login.
Do I give my app some kind of code and check against that? Or...?
Update: I see that there is anonymous login, which could solve the issue, but is that overkill? Does it actually help? Will it then keep my app from being used offline? ...etc