logo
On this page

Mute a conversation


Introduction

Mute a conversation: A user can mute any conversation, and when the ZIM SDK receives a message for the conversation, it does not send a push notification, and the total count of unread messages does not increase.

Enable for mute a conversation

To mute a conversation, call the setConversationNotificationStatus method with the conversationID parameter.

// Set a conversation to the "Do Not Disturb" notification status
ZIM.GetInstance().SetConversationNotificationStatus(ZIMConversationNotificationStatus.DoNotDisturb, "CONV_ID",
    ZIMConversationType.Group, (string conversationID, ZIMConversationType conversationType,
        ZIMError errorInfo) =>
    {
        // Result of setting the "Do Not Disturb" notification status
    });

Get a silent conversation state

After setting the mute, the client will receive the conversationChanged notification event on the operation end and multi-end online devices. After the offline device re-logs in, the mute conversation state can be obtained through the ZIMConversation.notificationStatus property of the conversation list.

// 1. Listen for conversation change events
ZIM.GetInstance().onConversationChanged = (
    ZIM zim, List<ZIMConversationChangeInfo> conversationChangeInfoList) =>
{
    // Conversation change notification
};

// 2. Query the conversation list
ZIMConversationQueryConfig config = new ZIMConversationQueryConfig();
config.count = 10;
config.nextConversation = null;

// Pull the conversation list
ZIM.GetInstance().QueryConversationList(config, (List<ZIMConversation> conversationList,
                   ZIMError errorInfo) => 
{
        // Pull the result callback           
});

Previous

Manage unread message counts

Next

Delete conversation

On this page

Back to top