All one-one chat is send with Message Type as Chat. Thus the Message Archiving technique (shown below) worked fine for me to save/retrieve chat history.
// Setup message archiving
xmppMessageArchivingStorage = [XMPPMessageArchivingCoreDataStorage sharedInstance];
xmppMessageArchiving = [[XMPPMessageArchiving alloc] initWithMessageArchivingStorage:xmppMessageArchivingStorage];
[xmppMessageArchiving setClientSideMessageArchivingOnly:YES];
// Activate xmpp modules
[xmppMessageArchiving activate:xmppStream];
// Add delegate
[xmppMessageArchiving addDelegate:self delegateQueue:dispatch_get_main_queue()];
However for Group Chat, the message type sent is "groupchat" This will not be archived by the XMPPMessageArchivingCoreDataStorage
Can someone please guide me as to how I can achieve the Message Archiving for Group Chat Message.
This is the Series of Stanza that you will need to send to get Archived Messages. For more detail you can checkout http://xmpp.org/extensions/xep-0136.html
REQ
RES
REQ
RES
To Fetch List of all Conversations
You can easily get archive messages from xmpp core database. Use Below code.