logo
In-app Chat
SDK Error Codes
Powered Byspreading
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.

Procedure

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

Sample code
// Mute a conversation
// Take a group conversation as example
zim.setConversationNotificationStatus(ZIMConversationNotificationStatus.DO_NOT_DISTURB, "CONV_ID", ZIMConversationType.PEER, new ZIMConversationNotificationStatusSetCallback() {
    @Override
    public void onConversationNotificationStatusSet(ZIMError errorInfo) {
        // Set the callback for the results of mute notifications.
        if(errorInfo.code == ZIMErrorCodeSuccess) {
          // ......
        } else {
          // ......
        }  
    }
});
1
Copied!

Previous

Manage unread message counts

Next

Delete conversation