Browse SDKs · uni-app / uni-app x
SDKsuni-app

User overview

Understand user profiles, presence, friendships, friend requests, and the blacklist.

Copy

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:

TypeUse casePrimary APIs
OpenIMUserInfoCurrent user's profile, settings page, avatar, and nicknamegetSelfUserInfo(), setSelfInfo()
OpenIMPublicUserItemUser lookup, friend candidates, and profiles for users who are not friends; public alias of OpenIMUserInfogetUsersInfo()
OpenIMFriendUserItemFriend list, remarks, pinning, and relationship extension datagetFriendListPage(), getSpecifiedFriendsInfo()
OpenIMBlackUserItemUsers on the current account's blacklistgetBlackList(), addBlack(), removeBlack()
OpenIMFriendApplicationItemSent or received friend applications and their processing stateFriend-application query, accept, reject, and delete APIs
OpenIMUserStatusItemAggregated online state and online platformssubscribeUsersStatus(), 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

TaskRecommended page
Query public profiles by userID for friend candidates or profile cardsGet user profiles
Page through, search, or query friendships by IDGet the friend list
Send or process friend applicationsSend a friend application, Get received friend applications
Update friend informationUpdate friend information
Delete a friendshipDelete a friend
View and maintain the blacklistGet the blacklist
Read or update the current user's nickname, avatar, and extension dataUpdate your profile
Set account-level message receptionSet global message reception
Understand the current contract boundary for friend-add permissionSet friend request permissions
Subscribe to and read online statusSubscribe to online status
List, search, or retrieve selected group-member profilesList 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:

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.