SDKsAndroid
Get the current user profile
Use getSelfLocalUserInfo() to retrieve the local profile for the current user.
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
| Field | Description |
|---|---|
userID | Signed-in user ID. |
nickname | Current account nickname. |
faceURL | Current account avatar URL. |
ex | Current account extension string. |
attachedInfo Enterprise | Additional information with an application-defined format. |
globalRecvMsgOpt | Global message reception: 0 receive, 1 do not receive, 2 receive without notification. |
addFriendPermission Enterprise | Add-friend permission value; see Set friend request permissions for the meanings. |
Was this page helpful?