setGroupAttributes
Introduction
Set the group attributes.
It will add a new attribute, if the setting attribute not exists.
Works for AVChatRoom only temporarily.
The upper limit amount for attributes is 16, with the limit of 32 bytes for each attribute keys, and 4k for each values.
The total limit for attributes, including keys and values, is 16K.
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 | The attributes to set. |
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 setGroupAttributesRes = await TencentImSDKPlugin.v2TIMManager
.getGroupManager()
.setGroupAttributes(
'groupID',
{ custom: 'custom' }
);
if (setGroupAttributesRes.code === 0) {
}