SDKsiOS
Search groups
Search locally synchronized joined groups on iOS.
Invoke searchGroups:onSuccess:onFailure: to search locally synchronized groups by group ID or group name keywords:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
searchParam | OIMSearchGroupParam * | Yes | Search parameter model defining keywords and match targets. |
OIMSearchGroupParam properties
| Parameter | Type | Required | Description |
|---|---|---|---|
keywordList | NSArray<NSString *> * | Yes | List of search keyword strings. |
isSearchGroupID | BOOL | No | Whether to match keywords against group IDs. |
isSearchGroupName | BOOL | No | Whether 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
- Local search scope: This method searches strictly within locally cached joined groups; it does not query unjoined public groups across the server.
- Read-only query: Search operations do not trigger group delegate callbacks.
Was this page helpful?