Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(firestore): Include "metadata" property on snapshot #567

Closed
3 of 12 tasks
wibimaster opened this issue Feb 22, 2024 · 6 comments · Fixed by #705
Closed
3 of 12 tasks

feat(firestore): Include "metadata" property on snapshot #567

wibimaster opened this issue Feb 22, 2024 · 6 comments · Fixed by #705

Comments

@wibimaster
Copy link

Plugin(s)

  • Analytics
  • App
  • App Check
  • Authentication
  • Crashlytics
  • 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

@robingenz
Copy link
Member

I close this as duplicate of #467.

@wibimaster
Copy link
Author

@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 :)

@robingenz robingenz reopened this Feb 26, 2024
@robingenz
Copy link
Member

Sorry, in this case I keep it open.

@phjardas
Copy link
Contributor

+1 from me. Would be great to have this feature. 😊

phjardas added a commit to phjardas/capacitor-firebase that referenced this issue Aug 27, 2024
@phjardas
Copy link
Contributor

I've drawn a sketch of how the interface could look like, however I'm a bit hesitant to touch the corresponding native code.

@robingenz
Copy link
Member

@phjardas Thank you for the inspiration! I would change a few types, see #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.

robingenz pushed a commit that referenced this issue Aug 30, 2024
* Add Android, remove `source` option

The `source` option is only supported on the web platform and does not exist in
the Android SDK.

* Revert omission of `source` option, complete Android implementation

* pr updates

* pr update

* format code

* Add iOS implementation

* Add iOS implementation
robingenz added a commit that referenced this issue Aug 30, 2024
* feat(firestore): include `metadata` property on snapshot

* docs

* feat(firestore): include metadata property on snapshot (#567) (#707)

* Add Android, remove `source` option

The `source` option is only supported on the web platform and does not exist in
the Android SDK.

* Revert omission of `source` option, complete Android implementation

* pr updates

* pr update

* format code

* Add iOS implementation

* Add iOS implementation

---------

Co-authored-by: Philipp Jardas <philipp@jardas.de>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants