Browse SDKs · React Native
SDKsReact Native

User overview

Learn about current-user profiles, public user profiles, account settings, and online status in the OpenIM React Native SDK.

Copy

The OpenIM React Native SDK identifies users by userID. User APIs read and update the signed-in account's profile, retrieve public user profiles, and subscribe to user online status.

Friends, friend requests, and the blocklist belong to relationships between users. See Relationships overview.

User types

The React Native SDK returns different user objects for different scenarios:

TypeUse caseMain APIs
SelfUserInfoThe signed-in user's profile, avatar, nickname, and account-level message reception settinggetSelfUserInfo(), setSelfInfo()
PublicUserItemLooking up users and displaying public profile cardsgetUsersInfo()
UserOnlineStateA user's online status and online platform listsubscribeUsersStatus(), getSubscribeUsersStatus(), unsubscribeUsersStatus()

SelfUserInfo represents the signed-in user, while PublicUserItem represents public information available for lookup. Friend profiles, blocklist relationships, and group-member profiles use objects from the relationships or group capabilities.

Feature entry points

NeedRecommended page
Look up a public profile by userID for a profile cardGet user profiles
Read or update the current user's nickname, avatar, and extension dataGet your profile, Update your profile
Set the account-level message reception optionSet global message reception
Set how requests to add the current account are handledSet friend request permissions
Subscribe to, read, and cancel online-status subscriptionsSubscribe to online status, Get subscribed user status, Unsubscribe from online status
Manage friends, friend requests, or the blocklistRelationships overview

Event listeners

User state changes emit events. See the following pages for listener examples: