SDKsReact Native
Get current user profile
Retrieve the profile details of the authenticated account using the OpenIM React Native SDK.
Retrieve user profile details for the currently authenticated account:
const currentUser = await OpenIMSDK.getSelfUserInfo();Return value
Resolves to a SelfUserInfo object representing the current account:
| Field | Type | Description |
|---|---|---|
userID | string | OpenIM user ID identifying the current account. |
nickname | string | Account nickname. |
faceURL | string | Avatar image URL. |
createTime | number | Timestamp when the user account was created. |
globalRecvMsgOpt | MessageReceiveOptType | Account-level global message reception and do-not-disturb setting. |
ex | string | Custom business extension string. |
Invoke this method after successful authentication to populate user profile screens and avatar components. Clear any cached user state when switching accounts.
Was this page helpful?