I have a chat app powered by Firebase, and I'd like to get a timestamp from Firebase before pushing any data.
Specifically, I'd like to get the time that a user pushes the send button for a voice message. I don't actually push the message to Firebase until the upload was successful (so that the audio file is guaranteed to be there when a recipient receives the message). If I were to simply use Firebase.ServerValue.TIMESTAMP, there could be an ordering issue due to different upload durations. (A very short message following a very long one, for example.)
Is there anyway to ping Firebase for a timestamp that I'm not seeing in the docs? Thank you!
push()the key will be based on the local time when the user pressed the button. If you useFirebase.ServerValue.TIMESTAMPthe value written to the database will be exactly when the data is written to disk. What would the conflict be? Can you capture it in a snippet of code that shows the problem?