Use Firebase Server Timestamp in Firebase URL

I would like to use the current Firebase server time in the Firebase URL. Below is an example of what I'm trying to accomplish.

Firebase(url: "https://location.firebaseio.com/logs/<firebase_time_stamp>")
Firebase(url: "https://location.firebaseio.com/logs/" + Firebase.TIME_STAMP)

Is there anyway to do this? If so, I need it to work in Swift and Java. I know that you can do something similar as a child, but that’s not what I’m looking for.

+4
source share
2 answers

The timestamp of the server side of Firebase ( iOS , Android ) can be used only in values, not in keys.

, , , Firebase . :

Firebase, + ( , Firebase ServerValue) .

. /.info/serverTimeOffset.

+3

ServerValue.timestamp() 4.0.

let timeStamp = ServerValue.timestamp()

let str = "https://location.firebaseio.com/logs/\(timeStamp)"
0

All Articles