Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

[Feature request] Get Firebase timestamp #132

Closed
NordlingDev opened this issue Sep 19, 2016 · 5 comments
Closed

[Feature request] Get Firebase timestamp #132

NordlingDev opened this issue Sep 19, 2016 · 5 comments
Assignees
Milestone

Comments

@NordlingDev
Copy link

NordlingDev commented Sep 19, 2016

Android: https://firebase.google.com/docs/reference/android/com/google/firebase/database/ServerValue

iOS: https://firebase.google.com/docs/reference/ios/firebasedatabase/interface_f_i_r_server_value.html#a39c5a614879f2040d9355977a4879071

I feel like this should be a simple task to implement :) It's needed to prevent users to manipulate their local timestamp.

@EddyVerbruggen
Copy link
Owner

Thanks for the links to the SDK's, that's really helpful.

Do you also have a suggestion how you'd want to use this feature?

@NordlingDev
Copy link
Author

NordlingDev commented Sep 19, 2016

@EddyVerbruggen - No worries! I believe the most efficient way to use this is to follow the steps of the JS version of Firebase (link to documentation):

var timestamp = Firebase.ServerValue.TIMESTAMP;

Or we could wrap it in a function so the timestamp is retrieved from the server upon method call:

var timestamp = Firebase.ServerValue.TIMESTAMP();

Currently ServerValue only has TIMESTAMP (as documented here). But I would still suggest that ServerValue stays an object for other future values that may come.

@EddyVerbruggen
Copy link
Owner

Note to self: iOS doc, Android doc. Scroll down to 'Server Timestamps' for both platforms.

@EddyVerbruggen
Copy link
Owner

Hey @NordlingArt, I've now added a way to fill a property serverside based on this placeholder. Check the doc.

It's available now in the master (default) branch of this repo so if you want to test it, install the plugin from GitHub.

Is there anything else you need regarding this?

@NordlingDev
Copy link
Author

@EddyVerbruggen - Sorry for the late response. This is perfect, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants