Spent hours trying to solve this problem and I\'m stumped!
Trying to grab the Chat History between 2 users on my OpenFire server and I read that I plugin was needed
When you mention start tag in the request then it matches with the chat having the exact time stamp that's why it returns error code '404' or '500'. I ommited start tag from my request and wrote following code which returns whole chat history with the user.
NSXMLElement *iq1 = [NSXMLElement elementWithName:@"iq"];
[iq1 addAttributeWithName:@"type" stringValue:@"get"];
[iq1 addAttributeWithName:@"id" stringValue:@"pk1"];
NSXMLElement *retrieve = [NSXMLElement elementWithName:@"retrieve" xmlns:@"urn:xmpp:archive"];
[retrieve addAttributeWithName:@"with" stringValue:@"rahul@vishals-mac-pro.local"];
NSXMLElement *set = [NSXMLElement elementWithName:@"set" xmlns:@"http://jabber.org/protocol/rsm"];
NSXMLElement *max = [NSXMLElement elementWithName:@"max" stringValue:@"100"];
[iq1 addChild:retrieve];
[retrieve addChild:set];
[set addChild:max];
[[[self appDelegate] xmppStream] sendElement:iq1];
Here this will return whole chat history in XML response between user Rahul and the user currently logged in.
For more detailed info please refer this blog http://question.ikende.com/question/363439343236313430