【问题标题】:Getting the sent message time from openfire to xmpp in IOS在IOS中获取从openfire发送到xmpp的消息时间
【发布时间】:2015-04-19 04:41:57
【问题描述】:

如何使用 XMPP 框架获取从 open fire 发送到 IOS 模拟器的消息的时间和日期?现在,当它从模拟器发送到开火火花套件时,我正在模拟器中获得时间。但是当反之亦然时,时间和日期返回 nil。

【问题讨论】:

    标签: objective-c iphone xmpp


    【解决方案1】:

    根据XEP-203 中的规定,XMPP 消息可能包含可选的delay 有效负载和stamp 属性:

    <delay xmlns='urn:xmpp:delay'
                 from='juliet@capulet.com/balcony'
                stamp='2002-09-10T23:41:07Z'/>
    

    XMPPFramework 有 NSXMLElement (XEP_0203) 类别来处理该有效负载(以及旧格式)。如果[message delayedDeliveryDate] 返回nil 值,则消息没有时间戳,您应该考虑将当前时间存储为消息时间。大多数 XMPP 服务器仅在消息真正延迟时才添加时间戳(例如,发往/来自离线用户的消息)

    【讨论】:

      猜你喜欢
      • 2011-07-01
      • 2017-06-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多