motbantuangiauten
motbantuangiauten

Reputation: 151

Firestore document doesn't exist when apple reviewing my app

Firestore document doesn't exist when apple review my app. I dont know why. Here is my firestore database:

Firebase database

Firebase rulers:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{documents=**} {
        allow read;
    }
  }
}

I try to run on Simulator and my device (use Testflight), everything work fine. But when I submited to appstore, apple reviewer said my app crash when running. Here is crash log from Fabric:

Document '<FSTDocumentKey: public/configs>' doesn't exist. Check document.exists to make sure the document exists before calling document.data.

Document '<FSTDocumentKey: public/configs>' doesn't exist. Check document.exists to make sure the document exists before calling document.data.

I know I can fixed this by check .exist property. But I want to know what I'm wrong here?

Upvotes: 0

Views: 279

Answers (1)

motbantuangiauten
motbantuangiauten

Reputation: 151

Now, I knew what wrong here. After installed app, reviewer turn off the internet connection.

For Android and iOS, offline persistence is enabled by default.

In the first time, reviewer opening app, firestore will query from offline data, which doesn't exist in this time.

Docs: https://firebase.google.com/docs/firestore/manage-data/enable-offline?authuser=0

Upvotes: 2

Related Questions