Apple审核我的应用时,Firestore文档不存在

问题描述 投票:0回答:1

Apple审核我的应用时,Firestore文档不存在。我不知道为什么。这是我的firestore数据库:

Firebase database

Firebase统治者:

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

我尝试在Simulator和我的设备上运行(使用Testflight),一切正常。但是当我提交到appstore时,苹果评论员说我的应用程序在运行时崩溃了。这是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.

我知道我可以通过检查.exist属性来解决这个问题。但我想知道我错在哪里?

swift firebase google-cloud-firestore
1个回答
0
投票

现在,我知道这里有什么不对。安装应用程序后,审阅者关闭互联网连接。

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

第一次,审阅者打开应用程序,firestore将从脱机数据查询,这在此时间不存在。

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

© www.soinside.com 2019 - 2024. All rights reserved.