Setting Nickname and Avatar (Full Platform)
This document describes how to set the user's avatar and nickname.
Setting Avatar and Nickname
To customize the nickname or avatar, use the following API for update:
TUICallKit.createInstance(context).setSelfInfo("jack", "https:/****/user_avatar.png", callback)
TUICallKit.createInstance(context).setSelfInfo("jack", "https:/****/user_avatar.png", callback);
[[TUICallKit createInstance] setSelfInfo:@"" avatar:@"" succ:^{} fail:^(int code, NSString *errMsg) {}];
TUICallKit.createInstance().setSelfInfo(nickname: "", avatar: "") {} fail: { code, message in}
TUIResult result = TUICallKit.instance.setSelfInfo('userName', 'url:********');
const options = {nickName: 'jack',avatar: 'https:/****/user_avatar.png'}TUICallKit.setSelfInfo(options, (res) => {if (res.code === 0) {console.log('setSelfInfo success');} else {console.log(`setSelfInfo failed, error message = ${res.msg}`);}});
try {await TUICallKitServer.setSelfInfo({ nickName: "jack", avatar: "http://xxx" });} catch (error: any) {alert(`[TUICallKit] Failed to call the setSelfInfo API. Reason: ${error}`);}
Note
The update of the callee's nickname and avatar may be delayed during a call between non-friend users due to the user privacy settings. After a call is made successfully, the information will also be updated properly in subsequent calls.