ios - 如何在 ios 的 xmpp 框架中检查收到的消息是已读还是未读

标签 ios iphone xmpp xmppframework

我正在使用 xmppframework 开发聊天应用程序,我已成功完成发送和接收消息,但是

1) 如果我正在与用户 A 聊天,用户 B 向我发送消息,我如何识别用户 B 向我发送消息。 (我已经在核心数据中维护消息,因此消息将被保存) 2) 如何识别收到的消息是已读还是未读

注意:我使用了消息保存

 xmppMessageArchivingStorage = [XMPPMessageArchivingCoreDataStorage sharedInstance];
 xmppMessageArchivingModule = [[XMPPMessageArchiving alloc] initWithMessageArchivingStorage:xmppMessageArchivingStorage];

谢谢

最佳答案

你可以看看XEP-0184

这应该是消息节格式

<message
    from='sender@domain/resource'
    id='messageId-1010'
    to='receiver@domain/resource'>
  <body>your message </body>
  <request xmlns='urn:xmpp:receipts'/>
</message>

这是收到的响应消息

<message
    from='receiver@domain/resource'
    id='packetId'
    to='sender@domain/resource'>
  <received xmlns='urn:xmpp:receipts' id='messageId-1010'/>
</message>

此处 messageId-1010 将是唯一的,让您知道它是哪个消息响应。

关于ios - 如何在 ios 的 xmpp 框架中检查收到的消息是已读还是未读,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20537461/

相关文章:

erlang - 在 ejabberd 中以编程方式创建和删除 pubsub 节点

ios - AVPlayer 层有时不显示视频内容

iphone - ScrollView ContentOffset 和 ZoomScale

c# - .NET 中的异步 XmlReader?

ios - 以编程方式添加导航栏 iOS

iphone - 动态、本地化 NSString

mysql - 用 Mysql 配置 ejabberd,报错 p1_mysql.app not found

ios - UIImages 作为侧推菜单中的图标

ios - 插入 View Controller 动画时工具栏按钮闪烁(快速淡出)

ios - 当经/纬度接近时显示警报