Users overview
Understand user profiles, friendship relations, blocklists, and presence status in OpenIMClientSDK.
The OpenIM Flutter SDK identifies users by their userID. When implementing user profile cards, friend discovery, contact directories, or blocklists, differentiate between public user profiles, friend relationships maintained by the current account, and blocklist states.
Group member rosters, in-group nicknames, group roles, and membership administration belong to the group domain; see Retrieving group members overview.
User data models
OpenIM returns distinct user data structures depending on the operational context:
| Model | Target Use Case | Associated Guides |
|---|---|---|
UserInfo | Currently logged-in user profile, account settings, self avatar, nickname, and global message reception settings. | Get self profile, Update self profile |
PublicUserInfo | User search, friend discovery candidates, stranger profile cards. | Retrieve users |
FriendInfo | Friend list entries for the current user, friend remarks, and friendship custom extensions. (Note: the Dart model does not contain isPinned). | Get friend list with pagination, Get friends info |
BlacklistInfo | Users blocked by the current account. | Retrieve a list of blocked users, Block a user, Unblock a user |
UserStatusInfo | Real-time presence status and active platform indicators. | Subscribe to user status, Get subscribed user status |
A single userID can exist simultaneously in public directories, the friend roster, the blocklist, and group rosters. Prioritize FriendInfo when rendering contacts; use PublicUserInfo when displaying stranger profiles; and use GroupMembersInfo in group contexts. For conversation list titles and chat headers, use ConversationInfo.showName.
Functional directory
| Requirement | Recommended Guide |
|---|---|
Query public profiles by userID for friend discovery or profile cards | Retrieve users |
| Paginate, search, or inspect friend relationships | Get friend list with pagination |
| Send, query, accept, or reject friend applications | Get friend application list as recipient |
| Modify friend remarks and relationship extensions | Update friends |
| Remove friend relationships | Delete a friend |
| View and manage the blocklist | Retrieve a list of blocked users |
| Read or update the current user's nickname, avatar, and extensions | Update self profile |
| Configure account-wide message reception and DND rules | Set global message reception |
| Subscribe to and inspect user presence | Subscribe to user status |
| Retrieve group member lists, member search, or specific member details | Retrieving group members overview |
State management and listeners
Listen to and merge user domain events within their respective capability handlers:
- Current user profile updates: see Update self profile.
- Friend application changes: see Get friend application list as recipient.
- Friendship additions, deletions, and updates: see Get friend list with pagination.
- Blocklist modifications: see Block a user.
- Presence status changes: see Subscribe to user status.
UserManager and FriendshipManager each maintain a single listener instance in the Flutter SDK. Assemble all required callbacks centrally in an application-level state provider and register each listener once to prevent individual Widgets from overwriting one another.
Was this page helpful?