createTopicInCommunity
Introduction
Create a topic in a community group.
Only works since version of 4.0.1.
Community group only works with the SDK version of 4.0 and above, with Ultimate Edition, you can see the pricing plan here.
Parameter details
Parameter name | Parameter type | Required | Platform | Description |
---|---|---|---|---|
groupID | String | yes | All | The ID of the topic to create. |
topicInfo | V2TimTopicInfo | yes | All | The detail information of the new topic. |
Returned template
V2TimValueCallback<String>
{
code : int
desc : String
data : String // The ID of the topic to create.
}
Return value details
name | type | description |
---|---|---|
code | int | 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
V2TimTopicInfo topicInfo = V2TimTopicInfo(
customString: "",
draftText: "",
groupAtInfoList: [],
introduction: "",
isAllMute: false,
lastMessage: null,
notification: "",
selfMuteTime: 0,
topicFaceUrl: "",
topicID: "",
topicName: "",
unreadCount: 0,
);
V2TimValueCallback<String> createTopicInCommunityRes =
await TencentImSDKPlugin.v2TIMManager
.getGroupManager()
.createTopicInCommunity(
groupID: "groupID",
topicInfo: topicInfo,
);
if (createTopicInCommunityRes.code == 0) {
String? topicId = createTopicInCommunityRes.data;
}