Browse SDKs · React Native
Platform
SDKsReact Native

Check friend relationship

Batch verify friendship status with specified users using the OpenIM React Native SDK.

Copy

Batch verify whether friendship relationships exist between the authenticated user and specified target users:

const checks = await OpenIMSDK.checkFriend(['user_a', 'user_b']);

Parameters

ParameterTypeRequiredDescription
userIDListstring[]YesArray of user IDs to check.

Return value

Resolves to an array of FriendshipInfo[]:

FieldTypeDescription
userIDstringThe checked user ID.
resultnumberFriendship status: 1 indicates friends, 0 indicates not friends.

To inspect blacklist relationships, see Get blacklist.