A community is a large group of people brought together by common topics, and multiple topics can be created under the same community based on different interests.
Community groups are used to manage group members. All topics under the same community group are shared among members, who can send and receive messages within each topic independently.
See use cases of community groups here.
Community and topic management APIs are in the TencentImSDKPlugin.v2TIMManager.getGroupManager() core class.
Topic message APIs are in the TencentImSDKPlugin.v2TIMManager.getMessageManager() core class.
Note:
This feature is supported by Flutter SDK v4.0.0 or later. To use it, you need to purchase the Ultimate edition, go to the console, choose Feature Configuration > Group configuration > Group feature configuration > Community, and enable the community feature.
Community Group Management
Creating a community group
Call the createCommunity (Details) API to create the community group.
Multiple topics can be created under the same community group. All the topics are shared among group members, who can send and receive messages within each topic independently.
Note:
To use the feature, you need to go to the console, choose Feature Configuration > Group configuration > Group feature configuration > Community, enable the community feature and then enable the topic feature.
The community is a new powerful tool for entertainment collaboration and supports the community-group-topic hierarchy to isolate messages.
The customInfo of a community saves the topic group list of the community, while the customString field of each topic stores the topic group.
When a community is loaded, the customInfo field for the topic group list of the community (group) is used to display the group list. We recommend you store the field in the List<String> format.
To get the topics in each group, traverse the topic list and get the group of each topic through the customString of V2TimTopicInfo.
Note:
You can customize the key value of the customInfo field for the topic group list of the community (group).
The following sample code names it topic_category.
Getting the list of groups in the community
Call the getCommunityCategoryList(String groupID) method. Sample code:
getCommunityCategoryList(String groupID) async {
final Map<String, String>? customInfo = await getCommunityCustomInfo(groupID);
if(customInfo != null){
final String? categoryListString = customInfo["topic_category"];
It is recommended that you pass in JSON strings into V2TimTopicInfo customString.
For example, the recommended format for categoryName in the code below is {"category":"Group 1"}.