SDKsiOSEnterprise
Enable or disable burn after reading
Configure burn-after-reading mode for a conversation with OpenIM iOS SDK.
Enable or disable the private chat burn-after-reading feature for a direct conversation using setConversationPrivateChat:isPrivate:onSuccess:onFailure:.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | NSString * | Yes | Target conversation identifier. |
isPrivate | BOOL | Yes | Whether to enable burn after reading. Pass YES to activate or NO to deactivate. |
Code example
[[OIMManager manager] setConversationPrivateChat:@"c2c_user1002"
isPrivate:YES
onSuccess:^(NSString * _Nullable data) {
NSLog(@"setConversationPrivateChat success");
}
onFailure:^(NSInteger code, NSString *message) {
NSLog(@"setConversationPrivateChat failed: %ld %@", (long)code, message);
}];Return value
The onSuccess callback signifies that OpenIMServer processed the private chat setting request.
State changes after the call
- Local state merge: Merge the updated
isPrivateChatproperty into local conversation models usingconversationIDas the unique entity key. - Asynchronous event listening: Multi-terminal devices and local views receive updates via
onConversationChanged:inOIMConversationListener(see Retrieve the conversation list). - Duration configuration: Configure the message self-destruction countdown independently using Set the burn-after-reading duration. This feature applies specifically to 1-on-1 private conversations and operates independently of Periodically delete server-side messages.
Was this page helpful?