如何在Swift中包含服务器端时间戳

时间:2016-05-27 14:14:25

标签: ios swift firebase firebase-realtime-database

在firebase改进之前,我可以在任何结构中发布时间戳,例如

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

但在FIRServerValue.timestamp()成为(NSDictionary *)之后,我无法将时间戳作为值发布到数据库。

1 个答案:

答案 0 :(得分:2)

尝试["CreatedAt": [".sv": "timestamp"]...]
该密钥的保存值必须类似于:1464103942351