Get friend profiles
Batch query relationship profiles for specified friends by user ID.
Invoke getSpecifiedFriendsInfo() to retrieve friendship records for users with whom you maintain an established friendship. Pass an array of user IDs via userIDList, and optionally filter out blacklisted contacts via filterBlack.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
userIDList | string[] | Yes | An array of friend user IDs to query. |
filterBlack | boolean | No | Whether to exclude blacklisted users from the returned results. |
Code example
import { getSpecifiedFriendsInfo } from '@/uni_modules/unix-openim-sdk'
const result = await getSpecifiedFriendsInfo({
userIDList: ['user_a', 'user_b'],
filterBlack: true,
})
const friends = result?.friends ?? []Return value
The Promise resolves with an OpenIMFriendListResult | null object containing an array of OpenIMFriendUserItem elements in friends. Returned elements are not guaranteed to match the order of userIDList; map records by matching each item's userID. For data field definitions, see Get the friend list.
State changes after the call
To query public profiles for non-friend users, call Get user profiles. This query returns a point-in-time snapshot and does not trigger friend events.
Was this page helpful?