Users overview
Understand user profiles, friend relationships, blocklists, and online status in OpenIM iOS SDK.
The OpenIM iOS SDK identifies users using unique userID strings. When developing profile cards, contact lists, friend management workflows, or blocklists, differentiate between public user identities, mutual friend relationships, and blacklist states.
Group member rosters, group-specific nicknames, role levels, and member permissions belong to the group domain. For group member management, refer to Retrieve group members.
User data models
The OpenIM iOS SDK models user information through dedicated data objects depending on the business scenario:
| Model | Applicable scenario | Recommended documentation |
|---|---|---|
OIMUserInfo | The logged-in user's profile, settings views, personal avatar, nickname, and global message reception preferences. | View your profile, Update your profile |
OIMPublicUserInfo | Looking up application users, finding friend candidates, and displaying stranger profile cards. | Retrieve public profiles by user ID |
OIMFriendInfo | The current user's friend list, custom friend remarks, and relationship extension metadata. | Retrieve the friend list by page, Retrieve specified friends |
OIMBlackInfo | Users added to the current user's blacklist. | Retrieve the blocklist, Block a user, Unblock a user |
OIMUserStatusInfo | Real-time presence status and active platform indicators for target users. | Subscribe to user status |
A single userID can exist across public directory entries, friend relationships, blocklists, and group rosters. Prioritize OIMFriendInfo when displaying contacts, OIMPublicUserInfo for general directory entries, and OIMGroupMemberInfo within group contexts. Conversation titles and message header labels derive from OIMConversationInfo.showName.
Feature navigation
| Feature | Documentation |
|---|---|
Batch-query public profiles by userID for profile cards or search candidates | Retrieve public profiles by user ID |
| Paginate, search, or inspect friend relationships by ID | Retrieve the friend list by page |
| Send, query, accept, decline, or delete friend applications | Retrieve received friend requests |
| Update friend remarks and custom relationship extensions | Update friend information |
| Remove friend relationships | Delete a friend |
| Inspect and manage the current user's blacklist | Retrieve the blocklist |
| Read and modify the current user's nickname, avatar, and custom extensions | Update your profile |
| Configure account-level message reception and notification rules | Set global message reception |
| Subscribe to and inspect user online presence | Subscribe to user status |
| Query group member lists, perform member searches, or inspect member details | Retrieve group members |
State synchronization
User domain events are observed and merged using userID as the unique entity merge identifier:
- Self profile changes: Update your profile.
- Friend application updates: Retrieve received friend requests.
- Friend relationships and profile changes: Retrieve the friend list by page.
- Blacklist updates: Block a user.
- Online status changes: Subscribe to user status.
Fetch initial data snapshots via query APIs, then register domain delegates to merge real-time incremental updates into local caches and views.
Was this page helpful?