tencent cloud

Feedback

React Native

Last updated: 2024-01-31 16:19:23

    Feature Description

    Both local messages and cloud messages can be deleted. When cloud messages are deleted, such messages will be deleted both locally and from the cloud and cannot be recovered.
    If the last message is deleted, the lastMessage in the conversation will become the last but one message.

    Deleting a local message

    Call deleteMessageFromLocalStorage (Details) to delete a local message.
    Note:
    1. This API can only be used to delete a local historical message. After deleted, the message will be marked as deleted locally by the SDK and can no longer be pulled through getHistoryMessage.
    2. If the application is uninstalled and reinstalled, the delete marker will be lost locally, and the message can still be pulled through getHistoryMessage.
    Below is the sample code:
    TencentImSDKPlugin.v2TIMManager
    .getMessageManager()
    .deleteMessageFromLocalStorage("");

    Deleting a message from the cloud

    Call deleteMessages (Details) to delete messages from the cloud.
    This API deletes messages both locally and from the cloud, which cannot be recovered.
    Note:
    1. Up to 30 messages can be deleted per call.
    2. Messages to be deleted per call must be from the same conversation.
    3. This API can be called only once every second.
    4. If messages have been pulled on a device by an account, they will remain on the device after the API is called to delete them from the cloud; in other words, deleted messages are not synced.
    Below is the sample code:
    TencentImSDKPlugin.v2TIMManager
    .getMessageManager()
    .deleteMessages(["messageid"]);
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support