TIMProfileModifySelfUserProfile

Introduction

Modify self user profile

Parameter details

Parameter name Parameter type Required Description
param TIMProfileModifySelfUserProfileParam yes Param of modifying self user profile

Returned template

Promise<commonResult<string>>

{
    code: TIMResult | TIMErrCode;
    desc?: string | undefined;
    json_param?: string | undefined;
    json_params?: string | undefined; 
    user_data?: string | undefined;
}

Return value details

name type description
code TIMResultTIMErrCode Request result: Error codes. 0 means success.
desc string | undefined The description of the error. It will be empty if success.
json_param string | undefined Return value of calling API
json_params string | undefined Return value of calling API. Compatible field, which is returned in some cases.
user_data string | undefined ImSDK is responsible for transporting user-defined data without any processing

Code example

import TimRender from "im_electron_sdk/dist/renderer";
const timRenderInstance = new TimRender();
import { UserProfileItem, TIMProfileModifySelfUserProfileParam, UserProfileCustemStringInfo } from "im_electron_sdk/dist/interfaces";

let nickname = "";
let faceUrl = "";
let signature = "";
let customInfo: UserProfileCustemStringInfo = {
    user_profile_custom_string_info_key: "",     // required
    user_profile_custom_string_info_value: ""    // required
}

let profileParam: UserProfileItem = {
    user_profile_item_nick_name: nickname,  // required
    user_profile_item_gender: 0,   // optional, refer to[TIMGenderType]
    user_profile_item_face_url: faceUrl,   // optional
    user_profile_item_self_signature: signature,   // optional
    user_profile_item_add_permission: 0,   // optional, refer to[TIMProfileAddPermission]
    user_profile_item_location: 0,   // optional
    user_profile_item_language: 0,    // optional
    user_profile_item_birthday: 0,   // optional
    user_profile_item_level: 0,   // optional
    user_profile_item_role: 0,   // optional
    user_profile_item_custom_string_array: [customInfo],   // optional,Array<UserProfileCustemStringInfo>, refer to[UserProfileCustemStringInfo]
}

let param: TIMProfileModifySelfUserProfileParam = {
    json_modify_self_user_profile_param: profileParam, // required
    user_data: "",  // required
}
let { code } = await timRenderInstance.TIMProfileModifySelfUserProfile(param)
if (code == 0) {
    // success
}

results matching ""

    No results matching ""