iOS XMPP群聊实施 [英] iOS XMPP group chat implementation

查看:394
本文介绍了iOS XMPP群聊实施的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用robbiehanson XMPPframework创建聊天室。

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>

任何人都有任何想法启动MUC ??有没有任何示例代码?任何帮助将不胜感激。谢谢。

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

推荐答案

最后我明白了。它可能会帮助某人。在创建或加入会议室时,格式应为 yourRoomName@conference.YourDomainName.com 。会议是这里的关键词。

Finally I figured it out. It may help someone. While creating or joining the room, the format should be yourRoomName@conference.YourDomainName.com. The conference is the keyword here.

这篇关于iOS XMPP群聊实施的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆