Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to check received message is read or unread in xmpp framework in ios

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

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];

thanks

like image 844
Mitul Bhadeshiya Avatar asked Dec 12 '13 07:12

Mitul Bhadeshiya


1 Answers

You can have look to XEP-0184

This should be the message stanza format

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

And This is received response message

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

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

like image 131
Bhumeshwer katre Avatar answered Oct 06 '22 00:10

Bhumeshwer katre