1
XMPPJID *servrJID = [XMPPJID jidWithString:@"conference.localhost"];
XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:servrJID];
[iq addAttributeWithName:@"from" stringValue:[[self xmppStream] myJID].full];
NSXMLElement *query = [NSXMLElement elementWithName:@"query"];
[query addAttributeWithName:@"xmlns" stringValue:@"http://jabber.org/protocol/disco#items"];
[iq addChild:query];
[[self xmppStream] sendElement:iq];

the group remains as it was after killing the app, group rejoin automatically,

i am still getting the group name which i have left/deactivated with

 XMPPJID *roomJID = [XMPPJID jidWithString:Roomjdi];
XMPPRoomMemoryStorage *roomMemoryStorage = [[XMPPRoomMemoryStorage alloc] init];
XMPPRoom *xmppRooms = [[XMPPRoom alloc]
                       initWithRoomStorage:roomMemoryStorage
                       jid:roomJID
                       dispatchQueue:dispatch_get_main_queue()];

[xmppRooms removeDelegate:self delegateQueue:dispatch_get_main_queue()];

[xmppRooms deactivate];
[xmppRooms leaveRoom];

have you any idea why i am getting the group name again in this?

Hima Seta
  • 11
  • 3
  • Can you please explain more about you problem with the XMPPRoom Issue? –  Mar 30 '17 at 13:39

1 Answers1

2

If you deactivate the room first, it disconnect the room from stream. For that reason you can not leave room. So if you want to leave room, at first call leave room function then deactivate room.

Example:

XMPPJID *roomJID = [XMPPJID jidWithString:Roomjdi];
XMPPRoomMemoryStorage *roomMemoryStorage = [[XMPPRoomMemoryStorage alloc] init];
XMPPRoom *xmppRooms = [[XMPPRoom alloc]
                       initWithRoomStorage:roomMemoryStorage
                       jid:roomJID
                       dispatchQueue:dispatch_get_main_queue()];

[xmppRooms removeDelegate:self delegateQueue:dispatch_get_main_queue()];

[xmppRooms leaveRoom];
[xmppRooms deactivate];
  • it is not working. it again show the same room in my grouplist. – Hima Seta May 02 '17 at 10:14
  • can you send message into this room? Because may be you can successfully leave room but room does not delete from your database. – Nasser Munshi May 03 '17 at 05:44
  • yes, i can send messages also. and that are received by other group members too. The room is not get deleted from server. issue is that. – Hima Seta May 03 '17 at 08:22