createGroup

Introduction

Create a new group.

It is not allowed to create two groups with the same group ID for one specific sdkAPPID.

memberList can allocate memory he original group members, but not works for AVChatRoom, please provide null in this case.

The upper limit of the number of daily net increases of all group types is 10,000 for Pro Edition and Ultimate Edition, while the peak group count is 100,000 for them. There are additional fees for exceeding this limit, refers to here.

Community group only works with Ultimate Edition, you can see the pricing plan here.

Community is a powerful tool for entertainment collaboration. It supports the community-group-topic hierarchy where messages are isolated and a high number of members share the same set of friend relationships. In addition, it allows you to group members and set group permissions for viewing, speaking, and managing things.

For details about the Community, see this documentation.

Parameter details

Parameter name Parameter type Required Description
groupID string no The custom group ID.
groupType string yes The type of group.
groupName string yes The name of the group.
notification string no The original notification of the group.
introduction string no The introduction of the group.
faceUrl string no The URL of the avatar for the group.
boolean string no Is mute all the group member.
addOpt GroupAddOptEnum no The add group method and verification type.
memberList V2TimGroupMember[] yes The original group members list.
isSupportTopic boolean no isSupportTopic

Returned template

V2TimValueCallback<string>

{
    code : number
    desc : string
    data : string // The group ID
}

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 string The ID of the topic to create.

Code example

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


const createGroupRes = await TencentImSDKPlugin.v2TIMManager
    .getGroupManager()
    .createGroup({
        groupType: 'Public',
        groupName: 'groupName',
        notification: '',
        introduction: '',
        faceUrl: '',
        isAllMuted: false,
        isSupportTopic: false,
        addOpt: GroupAddOptEnum.V2TIM_GROUP_ADD_AUTH,
        memberList: [],
    });
if (createGroupRes.code === 0) {

    createGroupRes.data;
}

results matching ""

    No results matching ""