getGroupMessageReadMemberList

Introduction

Load the list of members who read or unread the specified group message.

This method only works with Ultimate Edition, you can find the pricing plan here.

You have to enable and configure this features in console manually, before using it, while it works for Work, Public and Meeting group only.

Parameter details

Parameter name Parameter type Required Description
messageID string yes The message ID to query for.
filter GetGroupMessageReadMemberListFilter yes The type of filter.
nextSeq number no The sequence number to query.
count number no The count to load once.

Returned template

V2TimValueCallback<V2TimGroupMessageReadMemberList>

{
    code : number
    desc : string
    data : {
        isFinished : boolean
        memberInfoList : V2TimGroupMemberInfo[]
        nextSeq : number
    }
}

Return value details

name type description
code number Request result: Error codes. 0 means success.
desc string The description of the error. It will be empty if success.
data [V2TimGroupMessageReadMemberList] The list of results.

Code example

import {
    TencentImSDKPlugin,
    GetGroupMessageReadMemberListFilter,
} from 'react-native-tim-js';


const target = await TencentImSDKPlugin.v2TIMManager
    .getMessageManager()
    .createTextMessage('test');
const groupTargetdId = target.data?.id;

const sendMessageRes = await TencentImSDKPlugin.v2TIMManager
    .getMessageManager()
    .sendMessage({
        id: groupTargetdId!,
        receiver: '',
        needReadReceipt: true,
        groupID: '',
    });


const getMessageReadReceipts = await TencentImSDKPlugin.v2TIMManager
    .getMessageManager()
    .getMessageReadReceipts([sendMessageRes.data!.msgID!]);
if (getMessageReadReceipts.code == 0) {
    getMessageReadReceipts.data?.forEach((element) => {

        element.groupID;
        element.msgID;
        element.readCount;
        element.timestamp;
        element.unreadCount;
        element.userID;
    });
}
const getGroupMessageReadMemberList = await TencentImSDKPlugin.v2TIMManager
    .getMessageManager()
    .getGroupMessageReadMemberList(
        sendMessageRes.data!.msgID!,
        GetGroupMessageReadMemberListFilter.V2TIM_GROUP_MESSAGE_READ_MEMBERS_FILTER_UNREAD,
        0,
        100
    );
if (getGroupMessageReadMemberList.code === 0) {

    getGroupMessageReadMemberList.data?.isFinished;
    getGroupMessageReadMemberList.data?.memberInfoList;
    getGroupMessageReadMemberList.data?.nextSeq;
}

results matching ""

    No results matching ""