CometChatMessageComposer
component into your app.
onSendButtonPress
event gets activated when the send message button is clicked. It has a predefined function of sending messages entered in the composer EditText
. However, you can overide this action with the following code snippet.
CometChatMessageComposer
component.
Component
. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
The list of events emitted by the Messages component is as follows.
Event | Description |
---|---|
ccMessageSent | Triggers whenever a loggedIn user sends any message, it will have two states such as: inprogress , success & error |
ccMessageEdited | Triggers whenever a loggedIn user edits any message from the list of messages. It will have two states such as: inprogress , success & error |
ccMessageLiveReaction | Triggers whenever a loggedIn clicks on live reaction |
CometChatMessageEvents
Listener’s
CometChatMessageEvents
Listener’s
Property | Description | Code |
---|---|---|
user | Used to pass user object of which header specific details will be show | user={chatUser} |
group | Used to pass group object of which header specific details will be shown | group={chatGroup} |
disableTypingEvents | Used to disable/enable typing events , default false | disableTypingEvents={true} |
disableSoundForOutgoingMessages | Used to toggle sound for outgoing messages | disableSoundForOutgoingMessages={true} |
initialComposertext | Used to set predefined text | initialComposertext="Your custom text" |
customSoundForOutgoingMessage | Used to give custom sounds to outgoing messages | customSoundForOutgoingMessage="your custom sound for messages" |
hideVoiceRecordingButton | used to hide the voice recording option. | hideVoiceRecording={true} |
hideCameraOption | toggle visibility of camera option from the attachment options. | hideCameraOption={true} |
hideImageAttachmentOption | toggle visibility of image attachment options. | hideImageAttachmentOption={true} |
hideVideoAttachmentOption | toggle visibility of video attachment options. | hideVideoAttachmentOption={true} |
hideAudioAttachmentOption | toggle visibility of audio attachment options. | hideAudioAttachmentOption={true} |
hideFileAttachmentOption | toggle visibility of file attachment options. | hideFileAttachmentOption={true} |
hidePollsAttachmentOption | toggle visibility of file polls attachment options. | hidePollsAttachmentOption={true} |
hideCollaborativeDocumentOption | toggle visibility of file Collaborative Document Option. | hideCollaborativeDocumentOption={true} |
hideCollaborativeWhiteboardOption | toggle visibility of file Collaborative Whiteboard Option. | hideCollaborativeWhiteboardOption={true} |
hideAttachmentButton | toggle visibility of hide attachment option. | hideAttachmentButton={true} |
hideStickersButton | toggle visibility of hide stickers option. | hideStickersButton={true} |
hideSendButton | toggle visibility of send button option. | hideSendButton={true} |
hideAuxiliaryButtons | toggle visibility of Auxiliary button option. | hideAuxiliaryButtons={true} |
disableMentions | Sets whether mentions in text should be disabled. Processes the text formatters If there are text formatters available and the disableMentions flag is set to true, it removes any formatters that are instances of CometChatMentionsFormatter. | disableMentions={true} |
attachmentOptions
, you can set a list of custom MessageComposerActions
for the MessageComposer Component. This will override the existing list of MessageComposerActions
.