FileTransfer using XmppFrameWork in ios

Note: My XEP-0096 implementation is different from your’s. Any way you created session so just get that ID It may help you: – (BOOL)xmppStream:(XMPPStream *)sender didReceiveIQ:(XMPPIQ *)iq { //**************** Handling the file transfer task *****************// NSLog(@”———- Check if this IQ is for a File Transfer ———-“); NSString *myFileTransferID = YOUR_SESSION_ID_GET_FROM_XEP–0096//[xmppFileTransfer xmppFileTransferResponse:(XMPPIQ *)iq]; if ([myFileTransferID length]>0) … Read more

XMPPFramework – Retrieve Archived Messages From Openfire Server

You have to do a request with <retrieve> (see http://xmpp.org/extensions/xep-0136.html) then you can take a specific time from the received <list> result. For example: Send: <iq type=”get” id=’pk1′> <list xmlns=”urn:xmpp:archive” with=”piyush@openfire”> <set xmlns=”http://jabber.org/protocol/rsm”> <max>30</max> </set> </list> </iq> Receive: <iq type=”result” id=”pk1″ to=”vivek@openfire/iphone”> <list xmlns=”urn:xmpp:archive”> <chat with=”piyush@openfire” start=”2012-07-04T13:16:12.291Z”/> <chat with=”piyush@openfire” start=”2012-07-05T08:25:31.555Z”/> <chat with=”piyush@openfire” start=”2012-07-05T12:38:24.098Z”/> <set xmlns=”http://jabber.org/protocol/rsm”> … Read more

XMPPFramework – How to create a MUC room and invite users?

After exploring various solutions, I’ve decided to compile and share my implementation here: Create an XMPP Room: XMPPRoomMemoryStorage *roomStorage = [[XMPPRoomMemoryStorage alloc] init]; /** * Remember to add ‘conference’ in your JID like this: * e.g. [email protected] */ XMPPJID *roomJID = [XMPPJID jidWithString:@”[email protected]”]; XMPPRoom *xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:roomStorage jid:roomJID dispatchQueue:dispatch_get_main_queue()]; [xmppRoom activate:[self appDelegate].xmppStream]; [xmppRoom … Read more

XMPPFramework – Implement Group Chat (MUC)

to get a list of rooms: NSString* server = @”chat.shakespeare.lit”; //or whatever the server address for muc is XMPPJID *servrJID = [XMPPJID jidWithString:server]; XMPPIQ *iq = [XMPPIQ iqWithType:@”get” to:servJID]; [iq addAttributeWithName:@”from” stringValue:[xmppStream myJID].full]; NSXMLElement *query = [NSXMLElement elementWithName:@”query”]; [query addAttributeWithName:@”xmlns” stringValue:@”http://jabber.org/protocol/disco#items”]; [iq addChild:query]; [xmppStream sendElement:iq]; check for response in delegate method: – (BOOL)xmppStream:(XMPPStream *)sender didReceiveIQ:(XMPPIQ … Read more