Browse SDKs · iOS
Platform
SDKsiOSEnterprise

Enable or disable burn after reading

Configure burn-after-reading mode for a conversation with OpenIM iOS SDK.

Copy

Enable or disable the private chat burn-after-reading feature for a direct conversation using setConversationPrivateChat:isPrivate:onSuccess:onFailure:.

Parameters

ParameterTypeRequiredDescription
conversationIDNSString *YesTarget conversation identifier.
isPrivateBOOLYesWhether 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 isPrivateChat property into local conversation models using conversationID as the unique entity key.
  • Asynchronous event listening: Multi-terminal devices and local views receive updates via onConversationChanged: in OIMConversationListener (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.