0

I tried to create a new group using XMPP Framework in iOS using the following code as per given here

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];

I did configure as said in the above specified thread with

[xmppRoom fetchConfigurationForm];

But there is no response coming to the method

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

or not even call is coming to this method. that means the group is not being created, right? No error is shown or nothing in Log.

Please tell me what is the mistake I have made or if there is something more I have to do with this.

Thanks in advance :D

Community
  • 1
  • 1
geet Sebastian
  • 677
  • 6
  • 12

1 Answers1

0

Do it in this way. This is in swift

    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()
Ga Ne Sh
  • 59
  • 9