如何通过 FCM 发送 firestore 时间戳?

How to send firestore timestamps through FCM?

我在 firestore 中有一个包含时间戳字段的文档,我想将其作为 firebase 云消息的有效负载发送。我正在使用来自 node.js 的管理 sdk,我想在 android 上接收消息。 有办法实现吗?

时间戳包含两个整数值,秒和纳秒。如果您想序列化该时间戳以将其发送到另一段代码,您所要做的就是将这两个值发送到另一段代码,然后使用将这两个值作为输入的 Timestamp constructor 重构时间戳.