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:@"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 am getting the response in the console as :
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>
Anybody have any idea to initiate MUC??Is there any sample code for this??Any help will be appreciated..Thanks in advance..
Finally I figured it out. It may help someone. While creating or joining the room, the format should be yourRoomName@conference.YourDomainName.com. 'conference' is the keyword here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With