SDKsReact Native
Check friend relationship
Batch verify friendship status with specified users using the OpenIM React Native SDK.
Batch verify whether friendship relationships exist between the authenticated user and specified target users:
const checks = await OpenIMSDK.checkFriend(['user_a', 'user_b']);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
userIDList | string[] | Yes | Array of user IDs to check. |
Return value
Resolves to an array of FriendshipInfo[]:
| Field | Type | Description |
|---|---|---|
userID | string | The checked user ID. |
result | number | Friendship status: 1 indicates friends, 0 indicates not friends. |
To inspect blacklist relationships, see Get blacklist.
Was this page helpful?