/ SDKs / Unity
SDKs
Chat SDKs Unity v4
Chat SDKs Unity
Chat SDKs
Unity
Version 4

Retrieve a list of users in a channel

Copy link

You can retrieve a list of participants who are currently online and receiving all messages from an open channel using the SbParticipantListQuery method.

Open channel

Copy link
SbParticipantListQueryParams queryParams = new SbParticipantListQueryParams();
SbParticipantListQuery query = openChannel.CreateParticipantListQuery(queryParams);

query.LoadNextPage((inUsers, inError) =>
{
    if (inError != null)
    {
        return; // Handle error.
    }
});

Group channel

Copy link

You can retrieve a list of members in a group channel using the Members property of a SbGroupChannel object. Members of a group channel are automatically updated when a user is online. But when a user is disconnected from the Sendbird server and then reconnected, you should call the Refresh() method to update their channels with the latest information. See the refresh all data related to a group channel section for the sample code.

IReadOnlyList members = groupChannel.Members;