SDKsAndroid
Delete a local message
Use deleteMessageFromLocalStorage to delete only the message copy on the current device.
deleteMessageFromLocalStorage() removes the message identified by conversationID and clientMsgID from this device only. It does not affect the server, other devices, or other users.
OpenIMClient.getInstance().messageManager.deleteMessageFromLocalStorage(
conversationID,
clientMsgID,
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Remove the message from the current conversation by clientMsgID.
}
@Override
public void onError(int code, String error) {
// Keep the message and report the failure.
}
}
);The success callback means the local record was deleted. No shared message event is triggered. A later synchronization or reinstall may retrieve the server copy again.
Was this page helpful?