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

Update a channel metacounter

Copy link

Updating channel metacounter is the same as creating channel metacounter. Values of existing keys will be updated and values of new keys will be added.

std::map<std::wstring, int64_t> metaCounters;
metaCounters[L"key1"] = 3;  // Update 1 to 3
metaCounters[L"key2"] = 4;  // Update 2 to 4
metaCounters[L"key3"] = 0;  // Add a new key-value item.

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