【问题标题】:XMPP create group not getting Response in iOSXMPP 创建组在 iOS 中没有得到响应
【发布时间】:2015-07-26 00:25:23
【问题描述】:

我尝试根据给定的here 使用以下代码在 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];

我确实按照上面指定的thread 配置了

[xmppRoom fetchConfigurationForm];

但是方法没有响应

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

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

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

提前致谢:D

【问题讨论】:

    标签: ios objective-c xcode xmppframework muc


    【解决方案1】:

    以这种方式进行。这很快

        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()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-05
      • 2016-06-22
      • 1970-01-01
      • 2023-01-23
      • 2016-04-05
      • 1970-01-01
      • 2016-01-09
      • 1970-01-01
      相关资源
      最近更新 更多