Browse SDKs · iOS
SDKsiOS

Users overview

Understand user profiles, friend relationships, blocklists, and online status in OpenIM iOS SDK.

Copy

OpenIM SDK identifies each user by userID. When implementing profile cards, friend requests, contacts, or blocklists, distinguish between a user's public profile, the current user's friend relationships, and blocklist status.

Group member lists, group nicknames, group roles, and member administration belong to the group domain. See Retrieve group members for details.

User types

OpenIM SDK returns different user objects for different scenarios:

TypeWhen to use itMain APIs
OIMUserInfoThe signed-in user's profile, settings page, avatar, nickname, and message-reception optiongetSelfInfoWithOnSuccess:onFailure:, setSelfInfo:onSuccess:onFailure:
OIMPublicUserInfoLooking up application users, finding friend candidates, and displaying profiles for users who are not friendsgetUsersInfo:onSuccess:onFailure:
OIMFriendInfoThe signed-in user's friend list, friend remarks, and relationship extension fieldsgetFriendListPageWithOffset:count:filterBlack:..., getSpecifiedFriendsInfo:filterBlack:...
OIMBlackInfoUsers blocked by the signed-in usergetBlackListWithOnSuccess:onFailure:, addToBlackList:ex:onSuccess:onFailure:, removeFromBlackList:onSuccess:onFailure:
OIMUserStatusInfoA user's online status and list of connected platformssubscribeUsersStatus:onSuccess:onFailure:

The same userID can appear in public-profile, friend, blocklist, and group-member data. Prefer OIMFriendInfo when displaying a contact, OIMPublicUserInfo when only the account's public profile is needed, and OIMGroupMemberInfo when displaying a group member. Conversation-list and chat-page titles belong to conversation data and should use OIMConversationInfo.showName.

Feature guide

The following table maps common user-related requirements to their recommended pages:

RequirementRecommended page
Look up public profiles by userID to find friend candidates or display profile cardsRetrieve public profiles by user ID
Paginate, search, or retrieve friend relationships by IDRetrieve the friend list by page
Send, retrieve, accept, reject, or delete friend-request recordsRetrieve received friend requests
Update friend informationupdateFriends:onSuccess:onFailure:
Delete a friend relationshipdeleteFriend:onSuccess:onFailure:
View and manage the current user's blocklistRetrieve the blocklist
Read or update the current user's nickname, avatar, and extended profileUpdate your profile
Configure account-level message reception and notification behaviorSet global message reception
Subscribe to and retrieve online statusSubscribe to user status
Retrieve group-member lists, search members, or retrieve specified member profilesRetrieve group members

State updates

Each category of user-related events is handled and merged on its owning page:

Each page first retrieves a snapshot, then merges incremental updates through the delegate owned by that page.