transistorsoft / cordova-background-geolocation-firebase

Firebase Adapter for Cordova Background Geolocation
MIT License
7 stars 5 forks source link

Add support for firebase.firestore.FieldValue.serverTimestamp() #15

Closed vincentdsf closed 4 years ago

vincentdsf commented 4 years ago

Your Environment

Expected Behavior

When trying to pass in params as parameter firestoreTimestamp: firebase.firestore.FieldValue.serverTimestamp() I want the Position-Doc to be successfully stored in Firstore with the Serverside Timestamp.

Actual Behavior

The following error comes and positions dont get stored in Firestore: WARN: - BackgroundGeolocation configuration error: TypeError: JSON.stringify cannot serialize cyclic structures.

Steps to Reproduce

  1. Add a parameter or extra field with value firebase.firestore.FieldValue.serverTimestamp() or FieldValue.serverTimestamp()

Context

I want Firestore Documents created by Background Plugin to have a timestamp created on server-side. If the user changes the phones time settings, the positions become invalid if an application depends on the correct timestamp.

Debug logs

WARN: - BackgroundGeolocation configuration error: TypeError: JSON.stringify cannot serialize cyclic structures.

Logs ``` PASTE_YOUR_LOGS_HERE ```

Anything else I can do to achieve my goal or is this something that needs to be implemented?

vincentdsf commented 4 years ago

Updated Issue with more information

christocracy commented 4 years ago

You can't do what you're attempting to do.

Use Firebase Functions to set server timestamp.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

stale[bot] commented 4 years ago

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.