Browse SDKs · Android
Platform
SDKsAndroidEnterprise

Enable or disable burn after reading

Toggle private chat mode (burn after reading) for a specific direct conversation.

Copy

Enable or disable burn-after-reading (private chat) mode for a direct chat conversation. When enabled, messages sent within the conversation trigger a countdown timer and delete automatically once the recipient views them.

Code example

OpenIMClient.getInstance().conversationManager.setOneConversationPrivateChat(
    new OnBase<String>() {
        @Override
        public void onSuccess(String data) {
            // Private chat status updated.
        }

        @Override
        public void onError(int code, String error) {
            // code and error describe the failure.
        }
    },
    conversationID,
    true
);

Parameters

ParameterTypeRequiredDescription
baseOnBase<String>YesCallback delivering the asynchronous operation result.
conversationIDStringYesTarget conversation identifier.
isPrivatebooleanYesPass true to enable burn after reading; pass false to disable it.

Return value

The successful callback indicates that the server updated the burn-after-reading flag for the conversation. You can customize the destruction countdown interval using Set burn-after-reading duration.

State changes after the call

Once the setting takes effect, the SDK triggers the OnConversationListener.onConversationChanged event. Locate the conversation by conversationID, update its isPrivateChat property, and reflect private chat indicators in your UI. For complete listener registration details, see Get the conversation list.