Browse SDKs · Android
SDKsAndroid

Get the current user profile

Use getSelfLocalUserInfo() to retrieve the local profile for the current user.

Copy
OpenIMClient.getInstance().userInfoManager.getSelfLocalUserInfo(
    new OnBase<LocalUser>() {
        @Override
        public void onSuccess(LocalUser user) {
            // Use user to display the current profile.
        }

        @Override
        public void onError(int code, String error) {
            // Handle the error.
        }
    }
);

After initialization and login, call this method to retrieve the current account's local profile. Success returns LocalUser with fields such as userID, nickname, faceURL, ex, attachedInfo, globalRecvMsgOpt, and addFriendPermission.

Returned fields

FieldDescription
userIDSigned-in user ID.
nicknameCurrent account nickname.
faceURLCurrent account avatar URL.
exCurrent account extension string.
attachedInfo EnterpriseAdditional information with an application-defined format.
globalRecvMsgOptGlobal message reception: 0 receive, 1 do not receive, 2 receive without notification.
addFriendPermission EnterpriseAdd-friend permission value; see Set friend request permissions for the meanings.