Chat / Android
Chat Android v4
Chat Android
Chat
Android
Home
/
Chat
/
Android
/
User
This is the new Docs for Chat SDK v4 for Android. To see the previous Docs, click here.

Update user profile

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 (.jpg), JPEG (.jpeg), or PNG (.png) file of up to 25 MB.

val params = UserUpdateParams().apply {
    nickname = NICKNAME
    profileImageUrl = PROFILE_URL
}
SendbirdChat.updateCurrentUserInfo(params) { e ->
    if (e != null) {
        // Handle error.
    }

    // The current user's profile is successfully updated.
    // You could redraw the profile in a view in response to this operation.
}

Or, you can upload a profile image directly using the profileImageFile property.

val params = UserUpdateParams().apply {
    nickname = NICKNAME
    profileImageFile = PROFILE_FILE
}
SendbirdChat.updateCurrentUserInfo(params) { e ->
    if (e != null) {
        // Handle error.
    }

    // A new profile images is successfully uploaded to the Sendbird server.
    // You could redraw the profile in a view in response to this operation.
}