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

Create user metadata

You can store additional information to users such as phone numbers, emails, or descriptions with user metadata, which can be fetched or rendered into the UI. A user metadata is a std::map<std::wstring, std::wstring> and it can be stored into a SBDUser object.

To store a user metadata into a SBDUser object, add key-value items after creating a std::map<std::wstring, std::wstring>, and pass it as an argument to a parameter when calling the CreateMetaData() method. You can put multiple key-value items in the map.

SBDUser* currentUser = SBDMain::GetCurrentUser();

std::map<std::wstring, std::wstring> metaData;
metaData[L"key1"] = L"value1";
metaData[L"key2"] = L"value2";

currentUser->CreateMetaData(metaData, [](const std::map<std::wstring, std::wstring>& meta_data, SBDError* error) {
    if (error != nullptr) {
        // Handle error.
        return;
    }
});