/ SDKs / JavaScript
SDKs
Chat SDKs JavaScript v4
Chat SDKs JavaScript
Chat SDKs
JavaScript
Version 4

Retrieve number of members who haven't received a message

Copy link

You can retrieve the number of members who haven’t received a specific message in a group channel. When the value of zero is returned, it means that the message has been successfully delivered to all members in the channel.

JavaScriptTypeScript
const createChannelParams = {
    invitedUserIds: [USER_2, USER_3],
};

const channel = await sb.groupChannel.createChannel(createParams);
channel.sendUserMessage({
    message: 'Hi Sendbirdians!',
})
    .onSucceeded((message) => {
    const numberOfUndeliveredMembers = channel.getUndeliveredMemberCount(message);
    // The number of members who haven’t received the message.
    // ...
    })
    .onFailed((err, message) => {
    // Handle error.
    });