Browse SDKs · Flutter
SDKsFlutter

Users overview

Understand user profiles, friend relationships, the blocklist, and online status in OpenIMClientSDK.

Copy

OpenIMClientSDK identifies each user by userID. When implementing profile cards, friend requests, contacts, or a blocklist, distinguish an application's public user profile from the current user's friend relationship and blocklist state.

Group member lists, in-group nicknames, group roles, and member administration belong to the Groups domain. See Retrieve group members.

User types

OpenIMSDK returns different user objects for different scenarios:

TypeUse caseMain APIs
UserInfoThe current user's profile, settings page, avatar, nickname, and global receive settinggetSelfUserInfo(), setSelfInfo()
PublicUserInfoApplication user lookup, friend candidates, and profiles for users who are not friendsgetUsersInfo()
FriendInfoThe current user's friend list, friend remarks, and relationship extension data. The SDK model does not contain isPinnedgetFriendListPage(), getFriendsInfo()
BlacklistInfoUsers blocked by the current usergetBlacklist(), addBlacklist(), removeBlacklist()
UserStatusInfoUser online status and active platformssubscribeUsersStatus(), getSubscribeUsersStatus()

The same userID can appear in public profile, friend, blocklist, and group member data. Prefer FriendInfo when displaying a contact, PublicUserInfo when only a public account profile is needed, and GroupMembersInfo for a group member. Conversation-list and chat-page titles belong to conversation data and should use ConversationInfo.showName.

Feature entry points

RequirementRecommended page
Retrieve public profiles by userID for friend candidates or profile cardsRetrieve public profiles by user ID
Page through, search, or retrieve friend relationships by IDRetrieve the friend list by page
Send, retrieve, accept, or reject friend applicationsRetrieve received friend applications
Update friend dataupdateFriends()
Delete a friend relationshipdeleteFriend()
View and maintain the current user's blocklistRetrieve the blocklist
Read or update the current user's nickname, avatar, and extension dataUpdate the current user's profile
Configure account-level message reception and do-not-disturb behaviorSet the global message receive option
Subscribe to and retrieve online statusSubscribe to user status
Retrieve or search group members and read specified member profilesRetrieve group members

State updates

Each capability page owns the listener and merge behavior for its user-related events:

In the Flutter SDK, UserManager and FriendshipManager each retain one listener. Combine the required callbacks in a shared state layer and set each listener once. Do not let multiple widgets overwrite one another's listeners.