Hello
A user create his profile including avatar.
My application convert, uploaded the the image file and updated user data
AmityCoreClient.newUserRepository()
.updateUser(email)
.avatarFileId(avatarFileId)
.displayName(displayName)
.update()
.then((AmityUser user) async {
Its working OK
Now the user wants to remove his Avatar
How to update the user data ?
To update user information please refer to this section: User - Amity Docs
Thanks
I know this section
The question is how to remove an avatar that was updated
The section describe how to update a new Avatar
Kobi
Remove the avatar is basically updated its value - which you might have to pass it as null, have you tried this approach yet?
You can not pass null instead of avatarFileId
- its error in the code
If you put ‘’ (empty string) instead of avatarFileId
- you will have an exception - Parameters validation error!
The command
AmityCoreClient.newUserRepository()
.updateUser(email)
.avatarFileId(avatarFileId)
.displayName(displayName)
.update()
.then((AmityUser user) async {
Thank you for your patience. After consulting with our team, it appears that the only way to remove your avatar is by uploading an avatar via a custom URL instead of avatarFileId. You can achieve this by setting a placeholder URL in the custom URL field.
Thanks I know this option by I prefer to to upload/download a photo for no avatar
I used this field to and short text NoAvatar
to sign that there is no avatar for this user
I will wait patiently to the option to remove the avatar by updating the avatarFileId
to null
1 Like