User overview
Learn about current-user profiles, public user profiles, account settings, and online status in the OpenIM React Native SDK.
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:
| Type | Use case | Main APIs |
|---|---|---|
SelfUserInfo | The signed-in user's profile, avatar, nickname, and account-level message reception setting | getSelfUserInfo(), setSelfInfo() |
PublicUserItem | Looking up users and displaying public profile cards | getUsersInfo() |
UserOnlineState | A user's online status and online platform list | subscribeUsersStatus(), 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
| Need | Recommended page |
|---|---|
Look up a public profile by userID for a profile card | Get user profiles |
| Read or update the current user's nickname, avatar, and extension data | Get your profile, Update your profile |
| Set the account-level message reception option | Set global message reception |
| Set how requests to add the current account are handled | Set friend request permissions |
| Subscribe to, read, and cancel online-status subscriptions | Subscribe to online status, Get subscribed user status, Unsubscribe from online status |
| Manage friends, friend requests, or the blocklist | Relationships overview |
Event listeners
User state changes emit events. See the following pages for listener examples:
- Current-user profile changes: Update your profile.
- User online-status changes: Subscribe to online status.
- Friend, friend-request, and blocklist changes: Relationships overview.
Was this page helpful?