TIMConvGetConvList
Introduction
Get conversation list
Conversation list includes convInfo object.
This retrieves local cached conversation. If something updated on the server, SDK will synchronize automatically, and inform user in convEventCallback.
There is no limit on the number of locally stored conversations.
Up to 100 conversations can be stored in the cloud. To increase this limit, upgrade to the Ultimate edition. Then you can set the limit to 500 in the console:
If the information of a conversation has not been updated for a long time, the conversation can be stored in the cloud for up to seven days. To extend the conversation storage period, contact us for application.
Locally stored conversations may not always be consistent with those stored in the cloud. If the user does not call the ConvDelete API to delete the local conversations, the conversations will always exist. However, up to 100 conversations can be stored in the cloud, and if the information of a conversation has not been updated for a long time, the conversation can be stored in the cloud for up to seven days. Therefore, local conversations displayed on different terminals may differ.
Parameter details
Parameter name | Parameter type | Required | Description |
---|---|---|---|
param | getConvList | yes | Param of getting conversation list |
Returned template
Promise<commonResult<Array<convInfo>>>
{
code: TIMResult | TIMErrCode;
desc?: string | undefined;
json_param?: Array<convInfo> | undefined;
json_params?: Array<convInfo> | undefined;
user_data?: string | undefined;
}
Return value details
name | type | description |
---|---|---|
code | TIMResult | TIMErrCode | Request result: Error codes. 0 means success. |
desc | string | undefined | The description of the error. It will be empty if success. |
json_param | Array< convInfo > | undefined | Return value of calling API |
json_params | Array< convInfo > | 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 { getConvList } from "im_electron_sdk/dist/interfaces";
let param: getConvList = {
userData: "", // optional
}
let { code } = await timRenderInstance.TIMConvGetConvList(param)
if (code == 0) {
// success
}