Enable or disable burn after reading
Toggle private chat mode (burn after reading) for a specific direct conversation.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
base | OnBase<String> | Yes | Callback delivering the asynchronous operation result. |
conversationID | String | Yes | Target conversation identifier. |
isPrivate | boolean | Yes | Pass 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.
Was this page helpful?