StreamBuilder snapshot is always ConnectionState.waiting

前端 未结 5 2040
故里飘歌
故里飘歌 2021-02-19 12:12

I thought I understood StreamBuilders but I have some doubts that are puzzling me.

I thought that a ConnectionState.waiting means that the connection with the stream is

5条回答
  •  鱼传尺愫
    2021-02-19 12:29

    This is likely to be your Firestore rules. If it's like this:

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

    then you'll have t be authenticated to grab the data. You can test this quickly (but not permanently) by allowing access to the DB from anyone ...

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

    ... but please do change it to something more secure afterwards.

提交回复
热议问题