capawesome-team / capacitor-firebase

⚡️ Firebase plugins for Capacitor. Supports Android, iOS and the Web.
https://capawesome.io/plugins/firebase/
Apache License 2.0
373 stars 97 forks source link

feat(firestore): add addCollectionGroupSnapshotListener #624

Closed svrznjak closed 2 months ago

svrznjak commented 4 months ago

Plugin(s)

Current problem

I am not sure but I think there is a very important feature missing. What I am trying to do is addCollectionSnapshotListener on collectionGroup query. Such a thing can be done with javascript firebase library like this: const resources = query(collectionGroup(getFirestore(), 'resources')); onSnapshot(resources, (querySnapshot) => { querySnapshot.forEach((doc) => { console.log(doc.data()); }); });

Preferred solution

Since there already are getCollection, addCollectionSnapshotListener and getCollectionGroup functions in API, I would suggest addCollectionGroupSnapshotListener function is added.

I made a quick glance at addCollectionSnapshotListener web code and I think whole function can be copied and only change that is needed is on line 212 where 'collecion' should be changed to 'collectionGroup'.

Alternative options

No response

Additional context

No response

Before submitting

robingenz commented 4 months ago

Thank you for your request. Would you be willing to create a PR?

svrznjak commented 3 months ago

Time files... Well, I am not familiar with capacitor plugins, but I can give it a try.

robingenz commented 3 months ago

Let me know if you have any questions. I am currently working on other issues, so it will take some time until I get to this issue. You can also sponsor the issue if you want me to prioritize it.