TIMMsgGetMessageReadReceipts
Introduction
Get message read receipt
Ultimate package only, Buy Ultimate package to enable it.
After entering the message list, the sender pulls historical messages first, and then calls the TIMMsgGetMessageReadReceipts to pull the message read receipt information.
Parameter details
Parameter name | Parameter type | Required | Description |
---|---|---|---|
msgGetGroupMessageReceipts | MsgGetGroupMessageReceiptsParam | yes | Param of getting message read receipt |
Returned template
Promise<commonResult<Array<MessageReceipt>>>
{
code: TIMResult | TIMErrCode;
desc?: string | undefined;
json_param?: Array<MessageReceipt> | undefined;
json_params?: Array<MessageReceipt> | 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< MessageReceipt > | undefined | Return value of calling API |
json_params | Array< MessageReceipt > | 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 { Json_get_msg_param, MsgGetMsgListParams, MsgGetGroupMessageReceiptsParam } from "im_electron_sdk/dist/interfaces";
let convId = ""
let convType = 0
let msgParam: Json_get_msg_param = {
msg_getmsglist_param_last_msg: '', // optional
msg_getmsglist_param_count: 0, // optional
msg_getmsglist_param_is_ramble: false, // optional
msg_getmsglist_param_is_forward: false, // optional
msg_getmsglist_param_last_msg_seq: 0, // optional
msg_getmsglist_param_time_begin: 0, // optional
msg_getmsglist_param_time_period: 0, // optional
}
let param1: MsgGetMsgListParams = {
conv_id: convId,// required
conv_type: convType,// required
params: msgParam,// required
user_data: '' // optional
}
const { code1, json_params } = await timRenderInstance.TIMMsgGetMsgList(param1)
if (code1 == 0) {
let param: MsgGetGroupMessageReceiptsParam = {
json_msg_array: JSON.stringify([
json_params[0]
]),
user_data: ""
}
const { code } = await timRenderInstance.TIMMsgGetMessageReadReceipts(param);
if (code == 0) {
// success
}
}