SDKsReact Native
Relationships overview
Learn about friends, friend requests, and blocklists in the OpenIM React Native SDK.
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:
| Type | Use case | Main APIs |
|---|---|---|
PublicUserItem | Looking up public profiles and displaying friend candidates or stranger profile cards | getUsersInfo() |
FriendUserItem | Friend lists, friend remarks, pinned friends, and relationship extension data | getFriendListPage(), getSpecifiedFriendsInfo() |
FriendshipInfo | Checking the friendship between the current user and target users | checkFriend() |
FriendApplicationItem | Received or sent friend requests and their handling status | getFriendApplicationListAsRecipient(), getFriendApplicationListAsApplicant() |
BlackUserItem | Blocklist relationships maintained by the current account | getBlackList(), addBlack(), removeBlack() |
Feature entry points
| Need | Recommended page |
|---|---|
| Look up public user profiles | Get user profiles |
| Page through, search, or look up friends by ID | Get the friend list, Search friends, Get friend profiles |
| Check a friendship | Check friendship |
| Update or delete a friendship | Update friend information, Delete a friend |
| Send or handle a friend request | Send a friend request, Get received friend requests, Accept a friend request, Reject a friend request |
| View and maintain the blocklist | Get the blocklist, Block a user, Unblock a user |
Event listeners
Relationship changes emit events. Listener examples are documented on the following pages:
- Friend-request changes: Get received friend requests.
- Friend and friend-profile changes: Get the friend list.
- Blocklist changes: Get the blocklist.
Was this page helpful?