【问题标题】:How to include a server-side timestamp in Swift如何在 Swift 中包含服务器端时间戳
【发布时间】:2016-05-27 23:58:39
【问题描述】:

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

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

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

【问题讨论】:

    标签: ios swift firebase firebase-realtime-database


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2020-10-24
      • 2018-11-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多