initGroupAttributes

Introduction

Initialize the group attributes.

This method will clear all attributes in the group.

Only works with AVChatRoom temporarily.

The upper limit of the amount of keys is 16.

The limit of the length of each keys is up to 32 bytes, while for values is up to 4,000 bytes.

The total size of all attributes is 16 k.

initGroupAttributes, setGroupAttributes, deleteGroupAttributes methods calculate request rate merged: SDK limit rate at 5 seconds 10 times, and the 8511 error code is returned after over limit; The server limit rate at 5 times in a second, and 10049 error code is returned after exceeding the limit.

Parameter details

Parameter name Parameter type Required Description
groupID string yes The group ID.
attributes StringMap yes Initial attributes.

Returned template

V2TimCallback

{
    code : number
    desc : string
}

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.

Code example



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


const initGroupAttributesRes = await TencentImSDKPlugin.v2TIMManager
    .getGroupManager()
    .initGroupAttributes(
        'groupID',
        { custom: 'custom' }
    );
if (initGroupAttributesRes.code === 0) {

}

results matching ""

    No results matching ""