Transient messages are messages that are sent in real-time only and are not saved or tracked anywhere. The receiver of the message will only receive the message if he is online and these messages cannot be retrieved later.Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Send a Transient Message
You can use thesendTransientMessage() method to send a transient message to a user or in a group. The receiver will receive this information in the onTransientMessageReceived() method of the MessageListener class. In order to send the transient message, you need to use the TransientMessage class.
- Java
- Kotlin
Real-time Transient Messages
UseonTransientMessageReceived in MessageListener to receive transient messages.
- Java
- Kotlin
TransientMessage class consists of the below parameters:
| Parameter | Information |
|---|---|
| sender | An object of the User class holding all the information. related to the sender of the transient message. |
| receiverId | Unique Id of the receiver. This can be the Id of the group or the user the transient message is sent to. |
| receiverType | The type of the receiver - CometChatConstants.RECEIVER_TYPE_USER or CometChatConstants.RECEIVER_TYPE_GROUP |
| data | A JSONObject to provide data. |
Next Steps
Send Messages
Send text, media, and custom messages that are stored and retrievable
Receive Messages
Handle real-time message delivery with message listeners
Typing Indicators
Show real-time typing status for users and groups
Real-Time Listeners
Learn about all available real-time event listeners