Browse SDKs · uni-app / uni-app x
Platform
SDKsuni-app / uni-app x

Get friend profiles

Batch query relationship profiles for specified friends by user ID.

Copy

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

ParameterTypeRequiredDescription
userIDListstring[]YesAn array of friend user IDs to query.
filterBlackbooleanNoWhether 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.