I\'m a newbie in firebase.
How do I get through this below rule?
service cloud.firestore {
match /databases/{database}/documents {
match /{document
Because your method query the Firebase not Cloud Firestore so you should use this method :
FirebaseFirestore db = FirebaseFirestore.getInstance();
db.collection("YourCollectionName").get().addOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(@NonNull Task task) {
if (task.isSuccessful()) {
for (QueryDocumentSnapshot document : task.getResult()) {
Log.d(TAG, document.getId() + " => " + document.getData());
}
} else {
Log.w(TAG, "Error getting documents.", task.getException());
}
}
});
dont forget this :
implementation 'com.google.firebase:firebase-firestore:17.0.1'