Updated on 2025-07-28 GMT+08:00

Setting the Profile Picture Style

Function

This API is used to set the profile picture style.

Function Prototype

setAvatarStyle(avatarStyle: AvatarStyle, onSetAvatarStyleResult?: (ret: SDKERR, reason: string) => void): voidsetAvatarStyle(avatarStyle: AvatarStyle, onSetAvatarStyleResult?: (ret: SDKERR, reason: string) => void): void

Request Parameters

Table 1 Input parameter description
Parameter Mandatory Type Description
avatarStyle Yes AvatarStyle Profile picture style.
onSetAvatarStyleResult Yes (ret: SDKERR, reason: string) => void Callback of setting the profile picture style.
Table 2 AvatarStyle
Parameter Mandatory Type Description
backgroundColor Yes string Background color.
textColor Yes string Text color.
phoneIconPath Yes string Mobile phone icon.
boardIconPath Yes string Large display icon.
nameShowType No NameShowType Name display style.
avatarShape No AvatarShape Profile picture shape.
Table 3 Enumerated values of NameShowType
Enumeration Name Enumerated Value Description
FIRST_LETTER 0 Displays the first letter of the name.
FAMILY_NAME 1 Displays the last name.
Table 4 Enumerated values of AvatarShape
Enumeration Name Enumerated Value Description
CIRCLE 0 Circle.

Return Values

void

Callback Method Parameters

(ret: SDKERR, reason: string) => void

Table 5 Input parameter description
Parameter Type Description
ret For details about SDKERR, see Error Code Reference. Error code.
reason string Error description.