/ SDKs / .NET
SDKs
Chat SDKs .NET v4
Chat SDKs .NET
Chat SDKs
.NET
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.
    }
});