我想用robbiehanson XMPPframework創建聊天室。iOS XMPP羣聊實施
因爲我沒有得到任何的代碼和文檔,我做了一個嘗試自己發起的聊天室如下:
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"];
但我得到的控制檯響應:
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>
任何人有任何想法發起MUC?是否有任何示例代碼此??任何幫助將提前appreciated..Thanks ..