clearConversationAndDeleteAllMsg
Description
info
Delete the messages in a specified conversation from both local and server, but the conversation itself will still be kept.
Note
Related Callbacks:
onConversationChanged
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron
- React-Native
- Unity
Function Prototype
Future clearConversationAndDeleteAllMsg({
required String conversationID,
String? operationID,
})
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | String | Yes | Conversation ID |
Return Result
| Name | Type | Description |
|---|---|---|
| ~ | ~ | Operation successful if no exception is thrown |
Code Example
await OpenIM.iMManager.conversationManager.clearConversationAndDeleteAllMsg(conversationID: conversationID);
//todo
Function Prototype
- (void)clearConversationAndDeleteAllMsg:(NSString *)conversationID
onSuccess:(nullable OIMSuccessCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | NSString | Yes | Conversation ID |
Return Result
| Name | Type | Description |
|---|---|---|
| onSuccess | OIMSuccessCallback | Success return |
| onFailure | OIMFailureCallback | Failure return |
Code Example
[OIMManager.manager clearConversationAndDeleteAllMsg:@""
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void clearConversationAndDeleteAllMsg(String conversationID, OnBase<String> callBack)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | String | Yes | Conversation ID |
| callBack | OnBase | Yes | Callback interface |
Code Example
OpenIMClient.getInstance().messageManager.clearConversationAndDeleteAllMsg(conversationID,new OnBase<String>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(String data) {
}
})