How to Retrieve list of members chat room in using

2019-05-22 21:26发布

问题:

How can I retrieve the list of members of a chat room in using XMPP framework?

I tried using:

 - (void)xmppRoom:(XMPPRoom *)sender didFetchMembersList:(NSArray *)items 

But it returns an empty array. Any one please help me?

回答1:

when you joined the room delegate xmpproom delegate will call so after that return following code.

-(void)xmppRoomDidJoin:(XMPPRoom *)sender
{

    DDLogInfo(@"joined room");
    [sender fetchMembersList];
}

after that it calls following delegate method.

-(void)xmppRoom:(XMPPRoom *)sender didFetchMembersList:(NSArray *)items