Browse SDKs · iOS
Platform
SDKsiOS

Search groups

Search locally synchronized joined groups on iOS.

Copy

Invoke searchGroups:onSuccess:onFailure: to search locally synchronized groups by group ID or group name keywords:

Parameters

ParameterTypeRequiredDescription
searchParamOIMSearchGroupParam *YesSearch parameter model defining keywords and match targets.

OIMSearchGroupParam properties

ParameterTypeRequiredDescription
keywordListNSArray<NSString *> *YesList of search keyword strings.
isSearchGroupIDBOOLNoWhether to match keywords against group IDs.
isSearchGroupNameBOOLNoWhether to match keywords against group names.

Code example

OIMSearchGroupParam *param = [OIMSearchGroupParam new];
param.keywordList = @[@"tech discussion"];
param.isSearchGroupID = YES;
param.isSearchGroupName = YES;

[[OIMManager manager] searchGroups:param
                         onSuccess:^(NSArray<OIMGroupInfo *> *groups) {
                             [self showMatches:groups];
                         }
                         onFailure:^(NSInteger code, NSString *message) {
                             NSLog(@"searchGroups failed: %ld %@", (long)code, message);
                         }];

Return value

The onSuccess callback delivers an array of matched OIMGroupInfo objects (NSArray<OIMGroupInfo *> *). If no matching groups are found, it returns an empty array.

State changes after the call

  1. Local search scope: This method searches strictly within locally cached joined groups; it does not query unjoined public groups across the server.
  2. Read-only query: Search operations do not trigger group delegate callbacks.