【发布时间】:2016-12-09 02:19:35
【问题描述】:
我使用 Openfire 和 XMPP 成功实现了群聊。
现在当用户 A 向离线的用户 B 发送消息时,那么当用户 B 在线时,我如何从服务器检索所有未读/离线消息。
我这样做是为了加入房间,但它会从服务器获取所有消息:
- (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];
}
如何获取这些离线消息?
【问题讨论】:
标签: ios objective-c xmpp openfire