我正在尝试使用 robbiehanson XMPPframework 创建聊天室。
由于我没有得到任何示例代码或文档,我自己尝试发起一个聊天室,如下所示:
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"];
但我在控制台中得到的响应为:
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>
有人知道启动 MUC 吗?有没有示例代码?任何帮助将不胜感激..在此先感谢..