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

Retrieve a list of blocked users

Copy link

You can retrieve a list of all or specific blocked users in your Sendbird application. The LoadNextPage() method of SbBlockedUserListQuery returns a list of SbUser objects that contain information on the blocked users.

SbBlockedUserListQueryParams queryParams = new SbBlockedUserListQueryParams();
SbBlockedUserListQuery query = SendbirdChat.CreateBlockedUserListQuery(queryParams);

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

With the UserIdsFilter filter of SbBlockedUserListQuery(), you can retrieve a list of the blocked users with the specified user IDs.

SbBlockedUserListQueryParams queryParams = new SbBlockedUserListQueryParams();
queryParams.UserIdsFilter = new List<string> { "John", "Daniel", "Jeff" };

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