The Disappearing Messages extension allows end-users to send messages that disappear after a certain interval of time. This extension works for both private (one-on-one) and group messages.This extension is also known as exploding messages on some platforms.
Once the messages are sent, you can immediately schedule them for deletion using the disappearing messages extension. The message with the mentioned msgId gets deleted at timeInMS.
The value of timeInMS should strictly be less than 1 year
This extension uses the callExtension method provided by the CometChat SDK.
Copy
Ask AI
CometChat.sendMessage(textMessage) // Can be any type of message .then(message => { CometChat.callExtension('disappearing-messages','DELETE','v1/disappear',{ msgId: message.id, // The id of the message that was just sent timeInMS: 1633521809051 // Time in milliseconds. Should be a time from the future. }).then(response => { // Successfully scheduled for deletion }) // Logic to display the sent message on the screen. // ... }).catch(error => { // Error occured });