How to access all users using registries in XMPP server ejabberd

I am doing a chat using XMPP. I registered and logged in to the ejabberd server.

In the web interface, I see that there are 10 registered users and 4 users online. But Roster delegates don't get any contact.

I tried this solution. I have not received any results.

- (BOOL)xmppStream:(XMPPStream *)sender didReceiveIQ:(XMPPIQ *)iq
{
NSXMLElement *queryElement = [iq elementForName: @"query" xmlns: @"jabber:iq:roster"];

if (queryElement) {
NSArray *itemElements = [queryElement elementsForName: @"item"];
[ArrayUsers removeAllObjects];
for (int i=0; i<[itemElements count]; i++) {

    NSString *jid=[[[itemElements objectAtIndex:i] attributeForName:@"jid"] stringValue];
    [ArrayUsers addObject:jid];
}
}
return NO;
}

      

What could be the problem? Whether it is necessary to configure the server settings to receive contacts. Will it be available to everyone by default? Or I need to make a request to get the user's details and sync automatically with the CoreData store.

Any help would be much appreciated.

+3


source to share


2 answers


The problem was that the group registry module was not included in the ejabberd config file. You can just enable the mod_shared_roster

ejabberd config in the modules section (people who know how to do this will understand. I personally don't know! So I looked for help from others in the company). Then the shared list parameter will be available in the web interface of the administrative side of the ejabberd server.

Now configure the server to see how all users will be visible for each body using the following link: ejabbered config



Now, if you are logged in and have Roster auto sync set up (XMMP framework by RobbieHanson Eg), you will get all users on the list.

+2


source


Create a shared registry and start all users from the registry. Check this



0


source







All Articles