我有一些使用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;
}
}
}
错误:
客户端无权访问所需数据