SDKsReact Native
Get your profile
Get the current user profile with the OpenIM React Native SDK.
Call getSelfUserInfo() to get the signed-in account's user information.
const currentUser = await OpenIMSDK.getSelfUserInfo();Return result
The method returns the current account's SelfUserInfo:
| Field | Type | Description |
|---|---|---|
userID | string | The OpenIM user ID of the signed-in user. |
nickname | string | Account nickname. |
faceURL | string | Account avatar URL. |
createTime | number | Time when the user record was created. |
globalRecvMsgOpt | MessageReceiveOptType | The account's global message reception option. |
ex | string | An account extension string defined by your business. |
Call this method after initialization and login to display the current account's avatar, nickname, and global message reception setting. Clear the stored current-user information when switching accounts.
Was this page helpful?