Set burn-after-reading duration
Configure the destruction countdown interval (in seconds) for burn-after-reading messages in a conversation.
Configure the reading countdown interval (in seconds) for a conversation operating in burn-after-reading mode. Once burn-after-reading is active, messages trigger this destruction timer as soon as the recipient opens them.
Code example
OpenIMClient.getInstance().conversationManager.setConversationBurnDuration(
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Burn duration updated.
}
@Override
public void onError(int code, String error) {
// code and error describe the failure.
}
},
conversationID,
30
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
base | OnBase<String> | Yes | Callback delivering the asynchronous operation result. |
conversationID | String | Yes | Target conversation identifier. |
burnDuration | int | Yes | Countdown duration in seconds, such as 30. Do not confuse with scheduled server-side message deletion. |
Return value
The successful callback indicates that the server persisted the burn duration setting. To activate or deactivate burn-after-reading mode itself, call Enable or disable burn after reading.
State changes after the call
Once the duration takes effect, the SDK triggers the OnConversationListener.onConversationChanged event. Locate the conversation by conversationID and update its burnDuration property. For complete listener registration details, see Get the conversation list.
Was this page helpful?