0

我尝试使用以下代码在 iOS 中使用 XMPP 框架创建一个新组,按照此处给出

NSString *nickName=[NSString stringWithFormat:@"%@.nickName@conference.server.hostname.in" ,newGroupName ];

XMPPRoomMemoryStorage * roomMemory = [[XMPPRoomMemoryStorage alloc]init];
NSString* roomID = [NSString stringWithFormat:@"%@@conference.server.hostname.in" ,newGroupName ];
XMPPJID * roomJID = [XMPPJID jidWithString:roomID];

XMPPRoom* xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:roomMemory jid:roomJID dispatchQueue:dispatch_get_main_queue()];

[xmppRoom activate:self.xmppStream];
[xmppRoom addDelegate:self delegateQueue:dispatch_get_main_queue()];
[xmppRoom joinRoomUsingNickname:nickName history:nil password:nil];

我确实按照上面指定的线程中的说明进行了配置

[xmppRoom fetchConfigurationForm];

但是该方法没有响应

- (void)xmppRoomDidCreate:(XMPPRoom *)sender{
    DDLogVerbose(@"%@: %@", THIS_FILE, THIS_METHOD);
}

或者甚至没有调用这个方法。这意味着该组没有被创建,对吗?日志中没有显示错误或没有任何内容。

请告诉我我犯了什么错误,或者我是否还有其他事情要做。

先谢谢了

4

1 回答 1

0

这样做。这是在迅速

    let roomStorage: XMPPRoomMemoryStorage = XMPPRoomMemoryStorage()
    let roomJID: XMPPJID = XMPPJID.jidWithString("chatRoom10@conference.localhost")
    let xmppRoom: XMPPRoom = XMPPRoom(roomStorage: roomStorage,
        jid: roomJID,
        dispatchQueue: dispatch_get_main_queue())
    xmppRoom.activate(SKxmpp.manager().xmppStream)
    xmppRoom.addDelegate(self, delegateQueue: dispatch_get_main_queue())
    //xmppRoom.configureRoomUsingOptions(nil)
    xmppRoom.joinRoomUsingNickname(SKxmpp.manager().xmppStream.myJID.user, history: nil, password: nil)
    xmppRoom.fetchConfigurationForm()
于 2016-04-06T06:11:03.600 回答