0

My app is user-based, and so each user has his data saved in the app's Firestore Database.
When the app is in debug mode (installed on my device by Android Studio), there's no problem reading and writing to Firestore.
The problem is, when the app is installed from the Play Store (So I guess this means it's in release mode), the app is no longer able to read and write to the Firebase Database.
All of the SHA1 and SHA256 are added to the Firebase app, including the debug keys, release keys, and update keys, while I got the last two from the Play Console (of the specific app), so probably the problem doesn't lie in these keys.

Here're my Firestore rules, if there's any chance that they're relevant:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /users/{uid}{
        allow read, write: if request.auth.uid == uid;
    }
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

If any other code pieces are needed, say the word and I'll add them.

What's the problem, then?
And how can I fix it?
Help would be much appreciated!

Nitzan Daloomy
  • 166
  • 5
  • 24
  • Have you [checked](https://stackoverflow.com/a/51360406/5246885) this out? – Alex Mamo Sep 02 '22 at 06:50
  • @AlexMamo I've read it now, and as I said, I have added all of these keys – Nitzan Daloomy Sep 02 '22 at 10:05
  • Please share any error or log related to your issue. – Osvaldo Sep 02 '22 at 18:57
  • @Osvaldo I will, how can I get them though? Which errors am I expecting? I'll try to see if there're any errors during the data loading from the firestore, however, authenticating itself works – Nitzan Daloomy Sep 03 '22 at 16:41
  • As suggested [here](https://firebase.google.com/docs/firestore/security/get-started#writing_rule), in the *Allow all* tab example, you should *NEVER* use your second match statement in production because it allows anyone to overwrite your entire database. You could be hitting quota limits: if you’re on the free plan, writes, reads and deletes are limited. Take a look at this [authentication rule](https://firebase.google.com/docs/firestore/security/rules-conditions#authentication). Please share any message that appears in the Firebase console. – Osvaldo Sep 06 '22 at 17:21

0 Answers0