SDKsReact Native
Relationships overview
Understand friend relations, friend requests, and blacklists in the OpenIM React Native SDK.
Relationship capabilities manage social connections between the current user and other accounts—encompassing friendships, incoming and outgoing friend requests, and blacklists. User profiles, presence, and account settings are covered separately in User overview.
Relationship data structures
The SDK provides specialized models corresponding to each social state:
| Structure | Context | Applicable guides |
|---|---|---|
PublicUserItem | Search public profiles, display friend candidates, or render stranger cards | Get user profiles |
FriendUserItem | Friend list, friend remark aliases, pin status, and relationship extensions | Get friend list by page, Get specified friends info |
FriendshipInfo | Check whether a friendship exists between users | Check friend relationship |
FriendApplicationItem | Received or sent friend requests and their processing statuses | Get received friend applications, Get sent friend applications |
BlackUserItem | Blacklisted users maintained by the current account | Get blacklist, Add user to blacklist, Remove user from blacklist |
Browse by task
| Task | Recommended guide |
|---|---|
| Query public profiles | Get user profiles |
| Paginate, search, or query friends by ID | Get friend list by page, Search friends, Get specified friends info |
| Check friendship status | Check friend relationship |
| Modify or delete friendships | Update friend profile, Delete a friend |
| Send or process friend requests | Send a friend request, Get received friend applications, Accept a friend request, Refuse a friend request |
| Manage blacklists | Get blacklist, Add user to blacklist, Remove user from blacklist |
Event listeners
Relationship mutations trigger asynchronous events:
- Friend application events are documented in Get received friend applications.
- Friendship establishment, deletion, and profile changes are documented in Get friend list by page.
- Blacklist additions and removals are documented in Get blacklist.
Was this page helpful?