Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS XMPP group chat implementation

I am trying to create chat room using robbiehanson XMPPframework.

Since I didn't get any sample code or documentation, I made a try by myself to initiate a chat room as follows:

    XMPPRoomMemoryStorage *rosterstorage = [[XMPPRoomMemoryStorage alloc] init];
    XMPPRoom *xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:rosterstorage jid:[XMPPJID jidWithString:@"[email protected]/room"] dispatchQueue:dispatch_get_main_queue()];    
    [xmppRoom configureRoomUsingOptions:nil];
    [xmppRoom activate:[UIAppDelegate xmppStream]];
    [xmppRoom addDelegate:UIAppDelegate
            delegateQueue:dispatch_get_main_queue()];
   [xmppRoom inviteUser:[XMPPJID jidWithString:jabberID] withMessage:@"Hi join room"];

But I am getting the response in the console as :

 RECV: <message xmlns="jabber:client" from="[email protected]" to="[email protected]/42512304551337785705750233" type="error"><x xmlns="http://jabber.org/protocol/muc#user"><invite to="[email protected]"><reason>Hi join room</reason></invite></x><error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></message>

Anybody have any idea to initiate MUC??Is there any sample code for this??Any help will be appreciated..Thanks in advance..

like image 238
SINDHYA PETER Avatar asked Feb 20 '23 09:02

SINDHYA PETER


1 Answers

Finally I figured it out. It may help someone. While creating or joining the room, the format should be [email protected]. 'conference' is the keyword here.

like image 157
SINDHYA PETER Avatar answered Mar 05 '23 03:03

SINDHYA PETER