Browse SDKs · Android
SDKsAndroid

Set conversation message reception

Use setConversationRecvMessageOpt() to set message reception and notification behavior for one conversation.

Copy
OpenIMClient.getInstance().conversationManager.setConversationRecvMessageOpt(
    new OnBase<String>() {
        @Override
        public void onSuccess(String data) {
            // The request completed.
        }

        @Override
        public void onError(int code, String error) {
            // code and error describe the failure.
        }
    },
    conversationID,
    2
);
ValueMeaning
0Receive messages and allow notifications.
1Do not receive messages from this conversation or notify.
2Receive messages from this conversation without notification.

The account default is documented in Set global message reception. Conversation list changes for this setting can be received through onConversationChanged; see Get the conversation list for listener setup.