Using channel metacounter, you can store additional information to channels such as the tracking number of likes. A channel metacounter is an object that doesn't belong to a
Channel object and can be fetched or rendered into the UI.
A channel metacounter is primarily used to track and update discrete indicators in a channel. Use channel metacounter instead of channel metadata when you need an integer with increasing and decreasing atomic operations.
To store a metacounter into a channel, create a dictionary of key-value items where the key is a string and the value is an integer. Then pass the dictionary as an argument to a parameter when calling the
createMetaCounters() method. You can store multiple key-value items in the dictionary.
The procedure of updating a channel metacounter is the same as creating a channel metacounter. Values of existing keys will be updated and values of new keys will be added.
You can increase values in a channel metacounter by passing an object of keys as an argument to a parameter in the
increaseMetaCounters() method. The values of corresponding keys in the metacounter will increase by the number you've specified.
You can decrease values in a channel metacounter by passing an object of keys as an argument to a parameter in the
decreaseMetaCounters() method. The values of corresponding keys in the metacounter will decrease by the number you've specified.
You can retrieve channel metacounter by creating a collection of keys to retrieve and passing it as an argument to a parameter in the
getMetaCounters() method. A
MetaCounter object will return through the callback function with the corresponding key-value items.
You can delete a channel metacounter as below.