Implementing iOS XMPP group chat

I am trying to create a chat room using robbiehanson XMPPframework.

Since I didn’t have a sample code or documentation, I tried to start the chat room myself as follows:

    XMPPRoomMemoryStorage *rosterstorage = [[XMPPRoomMemoryStorage alloc] init];
    XMPPRoom *xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:rosterstorage jid:[XMPPJID jidWithString:@"test@mycompany.com/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 get a response in the console like:

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

Anyone have an idea to initiate a MUC? Is there any sample code for this? Any help would be appreciated. Thanks in advance.

+3
source share
3 answers
I finally figured it out. It might help someone. When creating or joining a room, the format should be yourRoomName@conference.YourDomainName.com . Conference is the key word here.
+5
source

"JID " (,), "" - MUC, "" - , . XEP-0045

" " XMPP.

+2

As far as I know, MUC is not possible with the XMPP facebook server, because it lacks one. They do not say this explicitly, but I found some tips in the wiki pidgin (German): http://wiki.pidgin-im.de/index.php/Facebook . I am also struggling with this topic ...

-1
source

All Articles