Chat / Unreal
Current version: v3
Chat Unreal v3
Chat Unreal
Chat
Unreal
Home
/
Chat
/
Unreal
/
Users

Retrieve a list of users

You can retrieve a list of all or specific users within your Sendbird application using the CreateAllUserListQuery() method. The LoadNextPage() method returns a list of SBDUser objects containing user information within the application.

SBDUserListQuery* query = SBDMain::CreateAllUserListQuery();

query->LoadNextPage([](const vector<SBDUser>& users, SBDError* error) {
    if (error != nullptr) {
        // Handle error.
        return;
    }

    // A list of users is successfully retrieved.
    // Through the users parameter of the handler callback function,
    // you can access the data of each user from the result list that the Sendbird server has passed to the handler callback function.
});

List of filters

NameFilters...

MetaDataFilter

Users with metadata containing an item with the specified key and values. This filter can be enabled using the SetMetaDataFilter() method.

// Retrieving users using the MetaDataKey filter.
std::vector<std::wstring> metaDataValues;
metaDataValues.push_back(L"movie");
metaDataValues.push_back(L"book");
metaDataValues.push_back(L"exercise");

SBDUserListQuery* query = SBDMain::CreateAllUserListQuery();

query->SetMetaDataFilter(L"hobby", metaDataValues);
query->LoadNextPage([](const vector<SBDUser>& users, SBDError* error) {
    if (error != nullptr) {
        // Handle error.
        return;
    }

    // A list of matching users is successfully retrieved.
});