I Successfully implemented group chat using Openfire with XMPP.
Now when User A send message to User B who is offline, So when User B is online how can I retrieve all unread/offline messages from server.
I'm doing this stuff to join the room but it getting all messages from server :
- (void) getJoinRoom
{
XMPPRoomMemoryStorage *roomStorage = [[XMPPRoomMemoryStorage alloc] init];
XMPPJID *roomJID = [XMPPJID jidWithString:chatWithUser];
xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:roomStorage
jid:roomJID
dispatchQueue:dispatch_get_main_queue()];
[xmppRoom activate:self.xmppStream];
[xmppRoom addDelegate:self
delegateQueue:dispatch_get_main_queue()];
[xmppRoom joinRoomUsingNickname:self.xmppStream.myJID.user
history:nil
password:nil];
}
How do I fetch those offline messages ?