getGroupCounters

Introduction

Get the group counters.

This method only works with Ultimate Edition, you can find the pricing plan here.

The key of a single group counter does not exceed 128 bytes, and the value must be an integer type (maximum support for 64-bit signed integer).

The setGroupCounters, increaseGroupCounter, and decreaseGroupCounter interfaces are merged and calculated. The SDK limits a maximum of 20 calls within 5 seconds for a single logged-in user. If the limit is exceeded, the interface will return error code 8516.

The getGroupCounters interface is calculated separately. The SDK limits a maximum of 20 calls within 5 seconds for a single logged-in user. If the limit is exceeded, the interface will return error code 8516.

If the incoming key list is empty, then return all group counters.

Works since version 1.0.25

Parameter details

Parameter name Parameter type Required Description
groupID string yes The group ID.
keys string no The counter keys.

Returned template

V2TimValueCallback<Map<String, number>>

{
    code : number
    desc : string
    data : Map<String, number>
}

Return value details

name type description
code number Request result: Error codes. 0 means success.
desc string The description of the error. It will be empty if success.
data Result list of getting group counters operation.

Code example

import { TencentImSDKPlugin } from 'react-native-tim-js';

const GetGroupCountersresponse = await TencentImSDKPlugin.v2TIMManager
    .getGroupManager()
    .getGroupCounters(
        groupID,
        key ? [key] : []
    );
if (GetGroupCountersresponse.code === 0) {

    GetGroupCountersresponse.data;
}

results matching ""

    No results matching ""