使用flutter从Firebase返回数据时出错?

时间:2020-01-03 08:38:10

标签: firebase flutter dart google-cloud-firestore

我开发了一个完全可以正常运行的管理应用程序,后来我释放了apk文件并将其发送给客户端,但它停止工作并抛出了错误。请有人帮助我这有什么问题。

错误:

I/flutter (21452): AsyncSnapshot<String>(ConnectionState.waiting, null, null)
I/flutter (21452): AsyncSnapshot<String>(ConnectionState.done, null, PlatformException(Error performing getDocuments, PERMISSION_DENIED: Missing or insufficient permissions., null))
I/flutter (21452): AsyncSnapshot<String>(ConnectionState.waiting, null, PlatformException(Error performing getDocuments, PERMISSION_DENIED: Missing or insufficient permissions., null))
I/flutter (21452): AsyncSnapshot<String>(ConnectionState.done, null, PlatformException(Error performing getDocuments, PERMISSION_DENIED: Missing or insufficient permissions., null))
I/flutter (21452): AsyncSnapshot<String>(ConnectionState.waiting, null, null)
I/flutter (21452): AsyncSnapshot<String>(ConnectionState.done, null, PlatformException(Error performing getDocuments, PERMISSION_DENIED: Missing or insufficient permissions., null))
I/flutter (21452): AsyncSnapshot<String>(ConnectionState.waiting, null, null)
I/flutter (21452): AsyncSnapshot<String>(ConnectionState.done, null, PlatformException(Error performing getDocuments, PERMISSION_DENIED: Missing or insufficient permissions., null))
I/flutter (21452): AsyncSnapshot<String>(ConnectionState.waiting, null, null)
I/flutter (21452): AsyncSnapshot<String>(ConnectionState.done, null, PlatformException(Error performing getDocuments, PERMISSION_DENIED: Missing or insufficient permissions., null))
I/flutter (21452): AsyncSnapshot<String>(ConnectionState.waiting, null, null)
I/flutter (21452): AsyncSnapshot<String>(ConnectionState.done, null, PlatformException(Error performing getDocuments, PERMISSION_DENIED: Missing or insufficient permissions., null))

这是我得到的错误

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {

    // This rule allows anyone on the internet to view, edit, and delete
    // all data in your Firestore database. It is useful for getting
    // started, but it is configured to expire after 30 days because it
    // leaves your app open to attackers. At that time, all client
    // requests to your Firestore database will be denied.
    //
    // Make sure to write security rules for your app before that time, or else
    // your app will lose access to your Firestore database
    match /{document=**} {
      allow read, write: if request.time < timestamp.date(2019, 12, 21);
    }
  }
}

0 个答案:

没有答案