Browse SDKs · React Native
SDKsReact Native

Check friendship status

Check friendships with the OpenIM React Native SDK.

Copy

Call checkFriend() to check the friendship between the current user and multiple target users.

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

The returned FriendshipInfo[] corresponds to the input IDs by userID:

FieldTypeDescription
userIDstringID of the user being checked.
resultnumber1 means the users are friends; 0 means they are not.

To determine a blocklist relationship, call Get the blocklist separately.