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

Create channel metadata

Copy link

You can store additional information to channels such as background color or a long description of a channel with channel metadata, which can be fetched or rendered into the UI. A channel metadata is a std::map<std::wstring, std::wstring> and it can be stored into a channel object. To store a channel metadata into a channel 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.

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

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