如何检查收到的消息是在ios的xmpp框架中读取还是未读取 [英] how to check received message is read or unread in xmpp framework in ios

查看:143
本文介绍了如何检查收到的消息是在ios的xmpp框架中读取还是未读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

i am developing chat application using xmppframework and i am successfully completed the send and receive message , but

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

1) if i am chat with user A and user B send me message the how can i identify the user B send me the message. (i already maintain the messages in core data so message will be saved) 2) how can i identify the received message is read or unread

注意:对于我使用的消息保存

NOTE : for message saving i used

 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 将是唯一的让你知道它是什么消息响应。

Here messageId-1010 will be unique to get you know which message response it is.

这篇关于如何检查收到的消息是在ios的xmpp框架中读取还是未读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆