SDKsiOS
Search friends
Search the current user’s friends with OpenIM iOS SDK.
searchFriends:onSuccess:onFailure: accepts an OIMSearchFriendsParam. Clear the search results immediately when the keyword is empty.
OIMSearchFriendsParam *param = [OIMSearchFriendsParam new];
param.keywordList = @[keyword];
param.isSearchUserID = YES;
param.isSearchNickname = YES;
param.isSearchRemark = YES;
[[OIMManager manager] searchFriends:param
onSuccess:^(NSArray<OIMSearchFriendsInfo *> *items) {
[searchStore replaceResults:items];
}
onFailure:nil];The success callback returns a search snapshot. Do not use it to overwrite the complete friend list. The query does not trigger a friendship delegate.
Was this page helpful?