Skip to main content

Set global Mute Notifications for the current user. After it is set successfully, the user no longer receives all offline message pushes. Time periods are supported. 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) {
}
});