capacitor-firebase
capacitor-firebase copied to clipboard
feat(firestore): Include "metadata" property on snapshot
Plugin(s)
- [ ] Analytics
- [ ] App
- [ ] App Check
- [ ] Authentication
- [ ] Crashlytics
- [X] Cloud Firestore
- [ ] Cloud Messaging
- [ ] Cloud Storage
- [ ] Performance
- [ ] Remote Config
Current problem
Firestore SDK permits to save data offline and persist online when connection is active. It let us know when the data is saved offline or online.
This Capacitor plugin doesn't have this option.
Preferred solution
Official documentation (web, swift, java) : https://firebase.google.com/docs/firestore/manage-data/enable-offline?hl=fr#web-modular-api_2
Is it possible to have the same feature on this Capacitor plugin ?
The addCollectionSnapshotListener
or addDocumentSnapshotListener
could have an option to add metadata property on snapshot result :)
Alternative options
No response
Additional context
No response
Before submitting
- [X] I have read and followed the feature request guidelines.
- [X] I have attached links to possibly related issues and discussions.
I close this as duplicate of #467.
@robingenz That's not really a dup', because it's not the same feature ; #467 is about getDocumentChanges()
of the querySnapshot
, and #567 is about metadata
property of a listener. But you can do both at the same time in #467 :)
Sorry, in this case I keep it open.
+1 from me. Would be great to have this feature. 😊
I've drawn a sketch of how the interface could look like, however I'm a bit hesitant to touch the corresponding native code.
@phjardas Thank you for the inspiration! I would change a few types, see https://github.com/capawesome-team/capacitor-firebase/pull/705. Maybe I'll get to the native implementation this weekend. But you are welcome to try it and create a PR against https://github.com/capawesome-team/capacitor-firebase/tree/feat/issue-567.