/ SDKs / Unreal
Chat SDKs Unreal v3
Chat SDKs Unreal
Chat SDKs
Version 3

Create user metadata

Copy link

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.