Browse SDKs · Android
SDKsAndroid

Revoke a message

Revoke a sent message and handle revocation notifications received by other clients.

Copy

Revoking a message causes other clients to display the original message in a revoked state. If the call fails, the error callback returns an error code and message.

messageManager.revokeMessageV2(callback, conversationID, clientMsgID);

The success callback means that the revocation request completed. Other clients receive the revocation notification through OnAdvanceMsgListener.onRecvMessageRevokedV2.

RevokedInfo contains the clientMsgID, revoker, and revocation time:

@Override
public void onRecvMessageRevokedV2(RevokedInfo info) {
    // info identifies the revoked message.
}

Update the matching message to a revoked state instead of deleting it from the list. MessageManager can retain only one OnAdvanceMsgListener. If the application handles other message events, implement their callbacks in the same listener. See Events for setup.