searchGroups

Introduction

Search for groups, with detailed group information.

This method will search for groups by the keywords.

Only supports with in local database.

Parameter details

Parameter name Parameter type Required Description
keywordList string[] yes The keywords list, maximum supports 5 keywords.
isSearchGroupID boolean no Is search by group ID.
isSearchGroupName boolean no Is search by group name.

Returned template

V2TimValueCallback<V2TimGroupInfo[]>

{
    code : number
    desc : string
    data : V2TimGroupInfo[]// The list of group searched.
}

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

Code example

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


const param = {
    isSearchGroupID: true,
    isSearchGroupName: true,
    keywordList: [],
};

const searchGroupsRes = await TencentImSDKPlugin.v2TIMManager
    .getGroupManager()
    .searchGroups(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 ""