searchGroups

Introduction

Search for groups, with detailed group information.

This method will search for groups by the keywords.

Only supports with in local database.

Supports since version 3.8.0.

Parameter details

Parameter name Parameter type Required Platform Description
searchParam V2TimGroupSearchParam yes All The list of keywords of searching, upper limit is 5 keywords.

Returned template

V2TimValueCallback<List<V2TimGroupInfo>>

{
    code : int
    desc : String
    data : List<V2TimGroupInfo>
}

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 List< V2TimGroupInfo > The list of group searched.

Code example

    V2TimGroupSearchParam param = V2TimGroupSearchParam(
        isSearchGroupID: true,
        isSearchGroupName: true, 
        keywordList: []);
    V2TimValueCallback<List<V2TimGroupInfo>> searchGroupsRes =
        await TencentImSDKPlugin.v2TIMManager
            .getGroupManager()
            .searchGroups(searchParam: param);
    if (searchGroupsRes.code == 0) {
      searchGroupsRes.data?.forEach((element) {
        element.customInfo; 
        element.faceUrl; 
        element.groupAddOpt; 
        element.groupID; 
        element.groupName; 
        element.groupType; 
        element.introduction; 
        element.isAllMuted; 
        element.isSupportTopic; 
        element.joinTime; 
        element.lastInfoTime; 
        element.lastMessageTime; 
        element.memberCount; 
        element.notification; 
        element.onlineCount; 
        element.owner; 
        element.recvOpt; 
        element.role; 
      });
    }

results matching ""

    No results matching ""