/ SDKs / Android
SDKs
Chat SDKs Android v4
Chat SDKs Android
Chat SDKs
Android
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 (.jpg), JPEG (.jpeg), or PNG (.png) file of up to 5 MB.

KotlinKTX
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.

KotlinKTX
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.
}