Browse SDKs · React Native
Platform
SDKsReact Native

Search groups

Search locally cached or joined groups by group ID or group name using the OpenIM React Native SDK.

Copy

Search locally cached or joined groups by group ID or name keywords:

const groups = await OpenIMSDK.searchGroups({
  keywordList: ['project'],
  isSearchGroupID: false,
  isSearchGroupName: true,
});

Parameters

ParameterTypeRequiredDescription
keywordListstring[]YesArray of keyword strings to search for.
isSearchGroupIDbooleanYesWhether to match group IDs against the search keywords.
isSearchGroupNamebooleanYesWhether to match group names against the search keywords.

Return value

A resolved Promise returns GroupItem[] matching the search criteria. Correlate and display group entries using groupID as the unique key. For field definitions, see Group overview.