Skip to main content

Remove the current user's message history locally and in the cloud. The removal is synchronized to the user's other devices. A successful call does not affect whether the other participant or other group members can continue viewing the messages. Batch removal of multiple messages in the same conversation is supported.

Parameters

NameTypeDescriptionVersion
conversationConversationConversation identifier1.0.0
clientMsgNoListList[]List of locally unique message numbers1.0.0
callbackIMessageManager.ISimpleCallbackResult callback1.0.0

Code Example

Conversation conversation = new Conversation(Conversation.ConversationType.GROUP, "groupId1");
List<Long> clientMsgNoList = new ArrayList<>();
clientMsgNoList.add(111L);
clientMsgNoList.add(222L);
clientMsgNoList.add(333L);
JIM.getInstance().getMessageManager().deleteMessagesByClientMsgNoList(conversation, clientMsgNoList, new IMessageManager.ISimpleCallback() {
@Override
public void onSuccess() {

}

@Override
public void onError(int errorCode) {

}
});