Note that there are some explanatory texts on larger screens.

plurals
  1. POGet All Username from OpenFire with XMPP
    text
    copied!<p>In my application I need to get <strong>All the UserName</strong> from <strong>OpenFire</strong>. </p> <p>i used below code but it doesn't give nil data. </p> <p>and i thing something is wrong in my <strong>didReceiveIQ</strong> method but using first time XMPP so don't get the actual problem. </p> <p>my code for getting data is </p> <pre><code>- (void)getAllRegisteredUsers { NSError *error = [[NSError alloc] init]; NSXMLElement *query = [[NSXMLElement alloc] initWithXMLString:@"&lt;query xmlns='http://jabber.org/protocol/disco#items' node='all users'/&gt;" error:&amp;error]; XMPPIQ *iq = [XMPPIQ iqWithType:@"get" to:[XMPPJID jidWithString:[NSString stringWithFormat:@"Domain Name with jid"]] elementID:[xmppStream generateUUID] child:query]; [xmppStream sendElement:iq]; } </code></pre> <p><br/></p> <pre><code>- (BOOL)xmppStream:(XMPPStream *)sender didReceiveIQ:(XMPPIQ *)iq { NSXMLElement *queryElement = [iq elementForName: @"query" xmlns: @"http://jabber.org/protocol/disco#items"]; NSLog(@"queryelement %@",queryElement); if (queryElement) { NSLog(@"query in if"); NSArray *itemElements = [queryElement elementsForName: @"item"]; NSMutableArray *mArray = [[NSMutableArray alloc] init]; for (int i=0; i&lt;[itemElements count]; i++) { NSString *jid=[[[itemElements objectAtIndex:i] attributeForName:@"jid"] stringValue]; [mArray addObject:jid]; NSLog(@"User in OpenFire = %@",jid); } NSLog(@"mArray = %@",mArray); } return NO; } </code></pre> <p>Any kind of help is appreciated....</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload