kemalony
kemalony

Reputation: 195

How to include a server-side timestamp in Swift

Before firebase improvements I could post timestamps in any struct like

let usermsg =  ["CreatedAt":FirebaseServerValue.timestamp(), "ChatTitle":msg.ChatTitle,"ChatBody":msg.ChatBody,  "Owner":self.GoogleUserID]

But after FIRServerValue.timestamp() became ( NSDictionary *) I could not get timestamp to post as a value to the database.

Upvotes: 2

Views: 979

Answers (1)

SATAN
SATAN

Reputation: 170

Try ["CreatedAt": [".sv": "timestamp"]...]
The saved value for that key must be something like: 1464103942351

Upvotes: 2

Related Questions