/ SDKs / .NET
SDKs
Chat SDKs .NET v4
Chat SDKs .NET
Chat SDKs
.NET
Version 4

Update user profile

Copy link

You can update a user's nickname and profile image with a profile URL using UpdateCurrentUserInfo(). A user's profile image can be a JPG, JPEG, or PNG file of up to 5 MB.

SbUserUpdateParams userUpdateParams = new SbUserUpdateParams();
userUpdateParams.NickName = "NEW_NICKNAME";
userUpdateParams.ProfileImageUrl = PROFILE_FILE_URL;

SendbirdChat.UpdateCurrentUserInfo(userUpdateParams, inError =>
{
    if (inError != null)
    {
        return; // Handle error.
    }
});

Or you can directly upload a profile image using the SbFileInfo constructor.

SbUserUpdateParams userUpdateParams = new SbUserUpdateParams();
userUpdateParams.NickName = "NEW_NICKNAME";
userUpdateParams.ProfileImageFile = new SbFileInfo(FILE_PATH);

SendbirdChat.UpdateCurrentUserInfo(userUpdateParams, inError =>
{
    if (inError != null)
    {
        return; // Handle error.
    }
});