我用左
PubNub.requestFullHistoryForChannel(channel , includingTimeToken: true , withCompletionBlock: { messages , channel , startDate , endDate , error in
let dic = messages[0].message as Dictionary<String , String>
let date = messages[0].date as PNDate! })
获取历史消息
当我使用println()来显示消息时**日期:PNDate **不是nil
"PNMessage (0x7fcb69d252c0): <message: {\n text = yup;\n type = fromUser;\n}, date: PNDate (0x7fcb69d25300) <date: 2015-02-17 12:21:31 +0000; time token: 14241756912535903>, channel: Hazem>"
答案 0 :(得分:0)
我可以从
获取发送消息的时间let date = messages[i].receiveDate as PNDate