回答
您需要在openfire中启用该选项才能获取聊天记录。 在openfire上登录,进入群组聊天,然后进入群组聊天设置,然后进入历史设置,然后选择显示整个聊天记录选项。
我已启用显示整个聊天记录选项。但我的问题是在openfire本身我可以看到聊天历史记录和一对一聊天记录我在哪里看到请让我知道 – Karthik
你想在openfire中看到聊天记录?或在应用程序? –
在openfire中添加监控服务,然后您将能够看到消息历史 –
关于加入xmpp组,您必须在xmpp核心数据库中编写以下用于存储消息的代码。
storage = [XMPPMessageArchivingCoreDataStorage sharedInstance];
moc = [storage mainThreadManagedObjectContext];
XMPPMessageArchiving *xmppMessageArchivingModule = [[XMPPMessageArchiving alloc] initWithMessageArchivingStorage:storage];
[xmppMessageArchivingModule setClientSideMessageArchivingOnly:YES];
[xmppMessageArchivingModule activate:xmppStream];
[xmppMessageArchivingModule addDelegate:self delegateQueue:dispatch_get_main_queue()];
在此之后,当你在特定的组输入您要使用下面的代码从XMPP核心数据库中获取历史
: -
XMPPMessageArchivingCoreDataStorage *_xmppMsgStorage = [XMPPMessageArchivingCoreDataStorage sharedInstance];
NSManagedObjectContext *moc = [_xmppMsgStorage mainThreadManagedObjectContext];
NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"XMPPMessageArchiving_Message_CoreDataObject" inManagedObjectContext:moc];
NSFetchRequest *request = [[NSFetchRequest alloc]init];
[request setEntity:entityDescription];
NSError *error;
NSString *predicateFrmt = @"bareJidStr == %@";
NSPredicate *predicate = [NSPredicate predicateWithFormat:predicateFrmt, [NSString stringWithFormat:@"%@%@",GroupName,GROUP_CHAT_DOMAIN]];
request.predicate = predicate;
NSArray *messages = [moc executeFetchRequest:request error:&error];
的
- 1. 获取XMPP聊天记录OpenFire
- 2. 获取BBM聊天记录
- 3. 如何从openfire聊天记录一对一聊天
- 4. Smack API - 从Openfire服务器中读取聊天记录
- 5. 在拿聊天记录我不是从Openfire的
- 6. XMPPFramework - 无法从Openfire服务器检索聊天记录
- 7. 从Openfire Sever获取聊天室列表使用Asmack
- 8. 如何获取openfire聊天室消息历史
- 9. 记录Quickblox视频聊天
- 10. 是否有WhatsApp SDK获取聊天记录(只有获取上次聊天和联系电话的时间)?
- 11. 如何从XMPP获取旧消息(聊天记录)
- 12. 获取Facebook聊天记录到移动xmpp客户端
- 13. 如何从XMPP获取聊天记录供ejabberd使用
- 14. Skype4COM获取所有最近的聊天记录
- 15. Java代码来获取两个用户之间使用来自openfire服务器的smack API的聊天记录
- 16. Openfire限制聊天客户端
- 17. 网页聊天,angularjs + Websocket + Openfire Vs angularjs + node.js
- 18. openfire(XMPP)服务器需要多长时间维护用户的聊天记录?
- 19. 聊天应用程序 - Socket.IO/Angular/MongoDB - 不显示聊天和聊天记录
- 20. 在Openfire和匿名登录上传输聊天对话
- 21. 获取Skype聊天列表
- 22. 获取Php聊天时间
- 23. SQL获取聊天查询
- 24. OpenFire Xmpp群聊
- 25. 保存三个月的聊天记录
- 26. 在AWS DynamoDB上存储聊天记录?
- 27. 使用chatadapter保存聊天记录
- 28. 在ios中存储聊天记录
- 29. 限制聊天记录的大小
- 30. 删除聊天记录从数据库
可能重复[啪API - 读取聊天室的Openfire服务器Histroy]( http://stackoverflow.com/questions/6635034/smack-api-read-chat-histroy-from-openfire-server) – legoscia
嗨Chiristian我可以看到服务器档案文件中的所有历史,我的问题是如何以编程方式获取这些细节列表 – Karthik