createTopicInCommunity

Introduction

Create a topic in a community group.

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

Parameter details

Parameter name Parameter type Required Description
groupID string yes The ID of the topic to create.
topicInfo V2TimTopicInfo yes The detail information of the new topic.

Returned template

V2TimValueCallback<string>

{
    code : number
    desc : string
    data : string // The ID of the topic to create.
}

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, V2TimTopicInfo } from 'react-native-tim-js';


const topicInfo: V2TimTopicInfo = {
    customString: '',
    draftText: '',
    groupAtInfoList: [],
    introduction: '',
    isAllMute: false,
    lastMessage: undefined,
    notification: '',
    selfMuteTime: 0,
    topicFaceUrl: '',
    topicID: '',
    topicName: '',
    unreadCount: 0,
};
const createTopicInCommunityRes = await TencentImSDKPlugin.v2TIMManager
    .getGroupManager()
    .createTopicInCommunity(
        'groupID',
        topicInfo
    );
if (createTopicInCommunityRes.code === 0) {

    createTopicInCommunityRes.data;
}

results matching ""

    No results matching ""