Ionic 4和Firebase:客户端无权访问所需数据

时间:2018-09-14 09:57:06

标签: firebase ionic-framework google-cloud-firestore

我有一些使用Firestore ddbb的Firebase应用程序,但这是唯一使用Ionic 4的应用程序。

这是我的代码:

...
private db: AngularFireDatabase
...
    const newspaperListRef = this.db.list<Newspaper>('newspapers', ref => ref.orderByKey());
    newspapersList$: Observable<Newspaper[]> = this.firebaseService.newspaperListRef.valueChanges();

规则:

service cloud.firestore {
  match /databases/{database}/documents {
    match /newspapers/{newspaperId} {
      allow read; // from public
    }
  }
}

我也尝试过:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      // Allow requests from authenticated users
            allow read, write: if request.auth != null;
    }
  }
}

错误:

  

客户端无权访问所需数据

0 个答案:

没有答案