sendMessage()
method and pass a TextMessage
object to it.
setMetadata
method and pass a JSON Object
to it.
setTags()
method of the TextMessage Class. The setTags()
method accepts a list of tags.
sendMessage()
method to send the text message to the recipient.
TextMessage
class constructor takes the following parameters:
Parameter | Description | Required |
---|---|---|
receiverID | UID of the user or GUID of the group receiving the message | YES |
messageText | The text message | YES |
receiverType | The type of the receiver- CometChat.RECEIVER_TYPE.USER or CometChat.RECEIVER_TYPE.GROUP | YES |
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 JSON Object
to it.
setCaption
method and pass text to it.
setTags()
method of the MediaMessage Class. The setTags()
method accepts a list of tags.
sendMediaMessage()
method, this file is then uploaded to CometChat servers and the URL of the file is sent in the success response of the sendMediaMessage()
function.MediaMessage
class constructor takes the following parameters:
Parameter | Description | Required |
---|---|---|
receiverId | The UID or GUID of the recipient. | YES |
file | The file object to be sent | YES |
messageType | The type of the message that needs to be sent which in this case can be: 1. CometChat.MESSAGE_TYPE.IMAGE 2. CometChat.MESSAGE_TYPE.VIDEO 3. CometChat.MESSAGE_TYPE.AUDIO 4. CometChat.MESSAGE_TYPE.FILE | YES |
receiverType | The type of the receiver to whom the message is to be sent. 1. CometChat.RECEIVER_TYPE.USER 2. CometChat.RECEIVER_TYPE.GROUP | YES |
MediaMessage
object which includes all information related to the sent message.
sendMediaMessage()
method, the files are uploaded to the CometChat servers & the URL of the files is sent in the success response of the sendMediaMessage()
method.MediaMessage
class constructor takes the following parameters:
receiverId | The UID or GUID of the recipient. |
files | An array of files. |
messageType | The type of the message that needs to be sent which in this case can be: 1. CometChat.MESSAGE_TYPE.IMAGE 2. CometChat.MESSAGE_TYPE.VIDEO 3. CometChat.MESSAGE_TYPE.AUDIO 4. CometChat.MESSAGE_TYPE.FILE |
receiverType | The type of the receiver to whom the message is to be sent. 1. CometChat.RECEIVER_TYPE.USER 2. CometChat.RECEIVER_TYPE.GROUP |
MediaMessage
object which includes all information related to the sent message.
You can use the setMetadata()
, setCaption()
& setTags()
methods to add metadata, caption and tags respectively in exactly the same way as it is done while sending a single file or attachment in a Media Message.
sendCustomMessage()
method.
The sendCustomMessage()
method takes an object of the CustomMessage
which can be obtained using the below constructor.
custom
.
The parameters involved are:
receiverId
- The 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 JSON Object.CustomMessage
class to set a specific type for the custom message. This can be achieved using the setSubtype()
method.
setTags()
method of the CustomMessage Class. The setTags()
method accepts a list of tags.
CustomMessage
class is ready you can send the custom message using the sendCustomMessage()
method.
CustomMessage
class.
shouldUpdateConversation(value: boolean)
method of the Custom Message.
Push, Email & SMS
notification of a custom message you can use the setConversationText(text: string)
method of Custom Message class.