How to fetch info of Chat Room + XMPP Framework + ios

2,859 views
Skip to first unread message

Nilesh Tripathi

unread,
Mar 7, 2014, 9:45:35 AM3/7/14
to xmppfr...@googlegroups.com

I have created a MembersOnly, Persistant Room. In which I have invited multiple occupants. Now I want to fetch detail of room for the user who were invited by the creator.

Invited user get the request and after accept it I want to fetch all detail of that particular chat room.

I tried this code :

XMPP requirement :

<iq from='ha...@shakespeare.lit/pda'
id='ik3vs715'
to='co...@chat.shakespeare.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>

iOS code

NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:@"http://jabber.org/protocol/disco#info"];//

NSString *iqID = [[appDelegate xmppStream] generateUUID];

XMPPJID *jID = self.room.roomJID;
XMPPIQ *element = [XMPPIQ iqWithType:@"get" to:jID  elementID:iqID child:query];
[element addAttributeWithName:@"from" stringValue:[[[appDelegate xmppStream] myJID] full]];
[[appDelegate xmppStream] fetchInformationForGivenIQ:element];

This should provide me this kinda result :

<iq from='coven@chat.shakespeare.lit'
id='ik3vs715'
to='hag66@shakespeare.lit/pda'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity
    category='conference'
    name='A Dark Cave'
    type='text'/>
<feature var='http://jabber.org/protocol/muc'/>
<feature var='muc_passwordprotected'/>
<feature var='muc_hidden'/>
<feature var='muc_temporary'/>
<feature var='muc_open'/>
<feature var='muc_unmoderated'/>
<feature var='muc_nonanonymous'/>
</query>
</iq>

But I am getting this result :

<iq xmlns="jabber:client" type="result" id="some ID" from="Group-ID" to="My Full JabberID">
<query xmlns="http://jabber.org/protocol/disco#info">
<feature var="http://jabber.org/protocol/disco#info">
</feature>
</query>
</iq>

Can any one help me what I am doing wrong.

One more thing, I tried to fetch the configuration for of the room by calling : 

[self.room configureRoomUsingOptions:nil];

Then After Configured 

-(void)room:(XMPPRoom *)sender didConfigure:(XMPPIQ *)iqResult;{

    [self fetchConfigurationOfRoom];

}

But result I got is error : 

<iq xmlns="jabber:client" type="error" id="4AA28A5F-CF0D-479F-84B6-4A43B5A3D1E5" from="Group ID" to="My FUll JID"><query xmlns="http://jabber.org/protocol/muc#owner"><x xmlns="jabber:x:data" type="submit"></x></query><error code="401" type="auth"><not-authorized xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></not-authorized></error></iq>

I missing one small part but Cant get it.

Need Help.

THanks in advance.

dee

unread,
Mar 13, 2014, 6:06:26 AM3/13/14
to xmppfr...@googlegroups.com
Try to send a IQ to get chatroom info like this :
<iq type="get" id="9C202C92-1CC6-4822-A879-F38AB0B0621F"><query xmlns="jabber:iq:private"><storage xmlns="storage:bookmarks"/></query></iq>

Nilesh Tripathi

unread,
Mar 14, 2014, 2:44:35 AM3/14/14
to xmppfr...@googlegroups.com
Thanks to reply dee
Here is the error I got for private room

<iq xmlns="jabber:client" type="error" id="5E1DC3F8-1D71-4AE5-8FFC-F9645522177C" from="My Group JID" to="JabberID/Resource"><query xmlns="jabber:iq:private"><storage xmlns="storage:bookmarks"></storage></query><error code="400" type="modify"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></bad-request></error></iq>

One more thing, I misguide you all as I didnt even get detail of PUblic room for the same way. Who ever has created the Room means whoever is the Owner is only can fetch the detail of that particular Public and NonPublic room. So consider this point and try to answer.

Awaiting for your reply.

Derek Zhang

unread,
Mar 15, 2014, 5:00:43 AM3/15/14
to xmppfr...@googlegroups.com
Hi, All

I build a XMPP Chat (+ openfire server ) from XMPP Framework, support full UI Feature, It is simple and extensible。

1. Support Text Message, Voice Note, and Picture Message, All the message encode for security.

2. All the message do not save on server,it base on XMPP protocol + ope fire server ,need not file server.

3. Implement the XEP-0054 、 XEP-0055 and XEP-0060 features.

4. Local database to store Roster 、Chat History 、Chat Session and XMPP event etc.

5. Support Invite/Chat/View buddy from Map View.

6. Support Block buddy, delete and invite buddy.

7. Full feature UI implement .

8. Support multi-language, iPhone4, iPhone5 etc. 

Download from : 



Then I want add Group Chat and VoIP functions,  Have anyone in the group give advice for this ? or any Demo for this?


thanks

Derek Zhang

发自我的 iPhone
--
You received this message because you are subscribed to the Google Groups "XMPPFramework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xmppframewor...@googlegroups.com.
To post to this group, send email to xmppfr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xmppframework/dde9f66f-b0bc-4035-8033-688ee527fd44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lory imilicia

unread,
Mar 19, 2014, 4:40:03 AM3/19/14
to xmppfr...@googlegroups.com
can u help me in developing a chat application with file transfer in ios and android any. Can u send me the source code. 
Reply all
Reply to author
Forward
0 new messages