Skip to main content

Set global Mute Notifications for the current user. When enabled, it suppresses offline push notifications during the configured time periods. If multiple devices set global Mute Notifications for the same user, the most recent successful setting takes effect.

Parameters

NameTypeDescriptionVersion
isMutebooleanWhether Mute Notifications is enabled1.1.0
periodsList<TimePeriod>Mute Notifications time periods. If empty, Mute Notifications applies all day.1.1.0
callbackISimpleCallbackResult callback1.1.0

Code Example

List<TimePeriod> list = new ArrayList<>();
TimePeriod p1 = new TimePeriod();
p1.setStartTime("11:22");
p1.setEndTime("23:24");
list.add(p1);
JIM.getInstance().getMessageManager().setMute(true, list, new IMessageManager.ISimpleCallback() {
@Override
public void onSuccess() {
}

@Override
public void onError(int errorCode) {
}
});