sendMessage()
method and pass a TextMessage
object to it.
setMetadata
method and pass a Map
to it.
.tags
variable of the TextMessage Class. tags
accepts a list of tags.
sendMessage()
method to send the text message to the recipient.
TextMessage
class constructor takes the following parameters:
Parameter | Description | |
---|---|---|
receiverID | UID of the user or GUID of the group receiving the message | Required |
messageText | The text message | Required |
receiverType | The type of the receiver- CometChatReceiverType.user (user) or CometChatReceiverType.group (group) | Required |
type | The type of the message that needs to be sent which in this case can be: CometChatMessageType.text __(text) |
TextMessage
object which includes all information related to the sent message.
sendMediaMessage()
method and pass a MediaMessage
object to it.
setMetadata
method and pass a Map
to it.
setTags()
method of the MediaMessage Class. The setTags()
method accepts a list of tags.
MediaMessage
class constructor takes the following parameters:
Parameter | Description | |
---|---|---|
receiverId | The UID or GUID of the recipient | Required |
file | The file object to be sent | Required |
messageType | The type of the message that needs to be sent which, in this case, can be: 1. CometChatMessageType.image (image) 2. CometChatMessageType.video (video) 3. CometChatMessageType.audio (audio) 4. CometChatMessageType.file (file) | Required |
receiverType | The type of the receiver to whom the message is to be sent, i.e., CometChatReceiverType.user (user) or CometChatReceiverType.group (group) | Required |
MediaMessage
object which includes all information related to the sent message.
If you wish to send a caption or some text along with the Media Message, you can use the caption field
provided by the MediaMessage class. To get and set the caption you can use the .caption
variable . As with text messages, the metadata field can be used with media messages as well. Any additional information can be passed along with the media message as a Map
.
sendCustomMessage()
method.
The sendCustomMessage()
methods takes an object of the CustomMessage
which can be obtained using the below constructor.
custom
.
The parameters involved are:
receiverUid
- Unique id of the user or group to which the message is to be sent.receiverType
- Type of the receiver i.e user or groupcustomType
- custom message type that you need to setcustomData
- The data to be passed as the message in the form of a Map
.CustomMessage
class to set a specific type for the custom message. This can be achieved using the subtype
field.
.tags
variable of the CustomMessage Class. tags
accepts a list of tags.
CustomMessage
class is ready you can send the custom message using the sendCustomMessage()
method.
CustomMessage
class.
updateConversation
(boolean value) method of the Custom Message.
Push, Email & SMS
notification of a custom message you can use the conversationText
method of Custom Message class.