SDKsiOSEnterprise
Set the burn-after-reading duration
Set a conversation’s burn-after-reading duration with OpenIM iOS SDK.
Configure the message destruction countdown duration for private chats using setConversationBurnDuration:duration:onSuccess:onFailure:.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | NSString * | Yes | Target conversation identifier. |
duration | NSInteger | Yes | Burn countdown interval in seconds (e.g., 30). |
Code example
[[OIMManager manager] setConversationBurnDuration:@"c2c_user1002"
duration:30
onSuccess:^(NSString * _Nullable data) {
NSLog(@"setConversationBurnDuration success");
}
onFailure:^(NSInteger code, NSString *message) {
NSLog(@"setConversationBurnDuration failed: %ld %@", (long)code, message);
}];Return value
The onSuccess callback signifies that OpenIMServer updated the burn-after-reading countdown duration.
State changes after the call
- Local state merge: Merge the updated
burnDurationproperty into local conversation records usingconversationIDas the entity key. - Asynchronous event listening: Linked devices observe updates via
onConversationChanged:inOIMConversationListener(see Retrieve the conversation list). - Feature boundary: This setting adjusts the message destruction timer specifically for private chats; enabling or disabling private chat mode is managed in Enable or disable burn after reading, and enterprise message expiration cycles are configured in Set the server message deletion cycle.
Was this page helpful?