Browse SDKs · React Native
SDKsReact Native

Relationships overview

Learn about friends, friend requests, and blocklists in the OpenIM React Native SDK.

Copy

Relationships record the current user's friendships, friend requests, and blocklist relationships with other users. User profiles, account settings, and online status are covered by the User overview.

Relationship objects

The React Native SDK returns different objects for different relationship scenarios:

TypeUse caseMain APIs
PublicUserItemLooking up public profiles and displaying friend candidates or stranger profile cardsgetUsersInfo()
FriendUserItemFriend lists, friend remarks, pinned friends, and relationship extension datagetFriendListPage(), getSpecifiedFriendsInfo()
FriendshipInfoChecking the friendship between the current user and target userscheckFriend()
FriendApplicationItemReceived or sent friend requests and their handling statusgetFriendApplicationListAsRecipient(), getFriendApplicationListAsApplicant()
BlackUserItemBlocklist relationships maintained by the current accountgetBlackList(), addBlack(), removeBlack()

Feature entry points

NeedRecommended page
Look up public user profilesGet user profiles
Page through, search, or look up friends by IDGet the friend list, Search friends, Get friend profiles
Check a friendshipCheck friendship
Update or delete a friendshipUpdate friend information, Delete a friend
Send or handle a friend requestSend a friend request, Get received friend requests, Accept a friend request, Reject a friend request
View and maintain the blocklistGet the blocklist, Block a user, Unblock a user

Event listeners

Relationship changes emit events. Listener examples are documented on the following pages: