User overview
Understand user profiles, presence, friendships, friend requests, and the blacklist.
unix-openim-sdk identifies users by userID. When implementing profile cards, friend requests, contacts, or blacklists, distinguish an application's public user profile from the current user's friendship, friend-application, and blacklist state.
Group member lists, in-group nicknames, group roles, and member management belong to the group domain. See List group members. Use userID as the cross-platform stable key; nicknames and avatars can change.
User types
The SDK returns different user objects for different scenarios:
| Type | Use case | Primary APIs |
|---|---|---|
OpenIMUserInfo | Current user's profile, settings page, avatar, and nickname | getSelfUserInfo(), setSelfInfo() |
OpenIMPublicUserItem | User lookup, friend candidates, and profiles for users who are not friends; public alias of OpenIMUserInfo | getUsersInfo() |
OpenIMFriendUserItem | Friend list, remarks, pinning, and relationship extension data | getFriendListPage(), getSpecifiedFriendsInfo() |
OpenIMBlackUserItem | Users on the current account's blacklist | getBlackList(), addBlack(), removeBlack() |
OpenIMFriendApplicationItem | Sent or received friend applications and their processing state | Friend-application query, accept, reject, and delete APIs |
OpenIMUserStatusItem | Aggregated online state and online platforms | subscribeUsersStatus(), getUserStatus() |
The same userID can appear in public, friend, blacklist, and group-member data. Prefer OpenIMFriendUserItem for contacts, OpenIMPublicUserItem for a stranger's profile card, and OpenIMGroupMemberItem in group-member lists. Conversation-list and chat-page titles come from conversation data and should use OpenIMConversationItem.showName.
Public OpenIMUserInfo fields include userID, nickname, faceURL, ex, and optional createTime. attachedInfo and globalRecvMsgOpt are Commercial fields; check for absence and do not assume that a public server returns them.
Feature pages
| Task | Recommended page |
|---|---|
Query public profiles by userID for friend candidates or profile cards | Get user profiles |
| Page through, search, or query friendships by ID | Get the friend list |
| Send or process friend applications | Send a friend application, Get received friend applications |
| Update friend information | Update friend information |
| Delete a friendship | Delete a friend |
| View and maintain the blacklist | Get the blacklist |
| Read or update the current user's nickname, avatar, and extension data | Update your profile |
| Set account-level message reception | Set global message reception |
| Understand the current contract boundary for friend-add permission | Set friend request permissions |
| Subscribe to and read online status | Subscribe to online status |
| List, search, or retrieve selected group-member profiles | List group members |
The application backend remains authoritative for account identity, verified identity, organization relationships, and business authorization. SDK profile fields are for chat presentation and cannot replace application login or authorization.
State updates
Query the relevant snapshot when a page opens, then merge incremental events:
- Current user profile changes: Update your profile.
- Friend application changes: Get received friend applications.
- Friendship and friend profile changes: Get the friend list.
- Blacklist changes: Get the blacklist.
- Online status changes: Subscribe to online status.
Merge all these lists idempotently by userID. Events are not a complete database recovery mechanism; requery the snapshots needed by the current UI after reconnect, re-login, account switch, or process restoration.
Was this page helpful?