User overview
Understand user profiles, account-level preferences, and online presence in the OpenIM HarmonyOS SDK.
OpenIMClientSDK uses userID as the unique user identifier. The user domain manages personal profiles, public profiles of other users, global notification settings, friend application permissions, and online presence. Friendships, friend applications, and blocklists belong to the relationship domain, whereas group-specific nicknames and role levels belong to the group domain.
Data models
| Model | Purpose |
|---|---|
IMUser | Account-level and public profile information for self and other users. |
IMFriend | Friend relationship record, including private remarks and relationship extensions. |
IMBlack | Blocklist entry maintained by the current account. |
IMGroupMember | Group-specific nickname, avatar, role level, and mute status. |
UserOnlinePlatform | Platform presence details for online users. |
A single user can appear simultaneously across multiple data sources. Contact lists should prioritize friend remarks, group rosters should display group member nicknames, and conversation headers should use showName. Never overwrite context-specific display labels with public nicknames.
Common operations
- Retrieve user profiles
- Retrieve current user profile
- Update current user profile
- Set global message reception
- Set friend request permission
- Subscribe to user online status
Query APIs establish initial data snapshots, while event listeners merge incremental updates in real time. Remember that API Promise resolution, asynchronous event arrival, and post-reconnection reconciliation represent three distinct stages.
Was this page helpful?