Mute Notification

Overview#

Mute notifications allow users to control their notification preferences. Users can enable or disable mute settings globally or for specific chats. This feature provides flexibility in managing interruptions.

Mute Chat#

To Mute the chat use below method which disables the notification for the chat when the new messages are received or any action on chat.

await SDK.updateMuteNotification(`TO_JIDS`, `IS_MUTED`);
StatusDescriptionTypeRequired
TO_JIDSArray of JID of the To UserArray Stringtrue
IS_MUTEDtrue for muting the chat, false for removingBooleantrue

Note: Please note that this method is triggered once the status 'success' is received from the server, indicating that the update was successful. At that point, the Mute Chat Listener method is called and receives the corresponding object values.

Get Mute Status#

To determine if a particular user is muted, use the method below. It returns the mute status of the specified user, if the user is muted return 1 else return 0.

await SDK.getMuteStatus(`TO_JID`);
StatusDescriptionTypeRequired
TO_JIDJID of the To UserJID Stringtrue

Enable/Disable Global Mute Settings#

Users can enable or disable global mute settings using the below method.

await updateSettings({ muteNotification : false or true})

Note: Please note that once the settings are updated, it's the responsibility of the foreground UI to determine whether or not to display the notification.