CometChatMessages
mainly contains below components in it.
Components | Description |
---|---|
MessageHeader | CometChatMessageHeader displays the User or Group information using CometChat SDK’s User or Group object. It also shows the typing indicator when the user starts typing in MessageComposer . |
MessageList | CometChatMessageList is one of the core UI components. It displays a list of messages and handles real-time operations. |
MessageComposer | CometChatMessageComposer is an independent and critical component that allows users to compose and send various types of messages includes text, image, video and custom messages. |
Details | CometChatDetails is a component that displays all the available options available for Users & Groups |
ThreadedMessages | CometChatThreadedMessages is a component that displays all replies made to a particular message in a conversation. |
pushViewController
function instead of presenting the view controller.
The Messages Component overrides the ThreadRepliesClick action to navigate to the ThreadedMessages component. If you override ThreadRepliesClick
, it will also override the default behavior of the Messages Component.
MessageListConfiguration
.
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 |
---|---|
onMessageSent | Triggers whenever a loggedIn user sends any message, it will have two states such as: inProgress & sent |
onMessageEdit | Triggers whenever a loggedIn user edits any message from the list of messages .it will have two states such as: inProgress & sent |
onMessageDelete | Triggers whenever a loggedIn user deletes any message from the list of messages |
onMessageRead | Triggers whenever a loggedIn user reads any message. |
onLiveReaction | Triggers whenever a loggedIn clicks on live reaction |
CometChatMessageEvents
Listener’s
CometChatMessageEvents
Listener’s
Property | Description | Code |
---|---|---|
set Background | Used to set the background color | .set(background: UIColor) |
set BorderColor | Used to set border color | .set(borderColor: UIColor) |
set BorderWidth | Used to set border width | .set(borderWidth: CGFloat) |
set CornerRadius | Used to set corner radius | .set(cornerRadius: CometChatCornerStyle) |
MessageListStyle
and MessageComposerStyle
and then applying them to the Messages Component using MessageListConfiguration
and MessageComposerConfiguration
.
Property | Description | Code |
---|---|---|
User | Used to pass user object of which header specific details will be shown | .set(user: User) |
Group | Used to pass group object of which header specific details will be shown | .set(group: Group) |
Hide MessageComposer | Used to toggle visibility for CometChatMessageComposer, default false | .hide(messageComposer: Bool) |
Hide MessageHeader | Used to toggle visibility for CometChatMessageHeader, default false | .hide(messageHeader: Bool) |
Disable Typing | Used to toggle functionality for showing typing indicator and also enable/disable sending message delivery/read receipts | .disable(disableTyping: Bool) |
Disable SoundForMessages | Used to toggle sound for messages | .disable(soundForMessages: Bool) |
Set CustomSoundForIncomingMessages | Used to set custom sound asset’s path for incoming messages | .set(customSoundForIncomingMessages: URL) |
Set CustomSoundForOutgoingMessages | Used to set custom sound asset’s path for outgoing messages | .set(customSoundForOutgoingMessages: URL) |
Hide Details | Used to toggle visibility for details icon in CometChatMessageHeader | .hide(details: Bool) |
setMessageHeaderView()
method. But keep in mind, by using this you will override the default message header functionality.
custom_header_view
and pass it inside the setMessageHeaderView()
method.
cometChatMessages
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.setMessageComposerView()
method. But keep in mind, by using this you will override the default message composer functionality.
custom_composer_style
while creating a MessageComposerStyle
object.
cometChatMessages
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.CustomMessageComposer
view.setAuxiliaryMenu()
method. Users can specify different auxiliary menu options that appear before the details option.
.setAuxiliaryMenu()
setAuxiliaryMenu()
method to establish its default functionality. By setting an Auxiliary Menu, the Messages Component gains the capability to navigate to the Details section.
MessageHeaderConfiguration
object.
MessageHeaderConfiguration
provides access to all the Action, Filters, Styles, Functionality, and Advanced properties of the MessageHeader component.
Please note that the Properties marked with the symbol are not accessible within the Configuration Object.Example In this example, we will be adding a custom back button and styling a few properties of the Avatar component of the MessageHeader component using
MessageHeaderConfiguration
.
MessageListConfiguration
object.
MessageListConfiguration
provides access to all the Action, Filters, Styles, Functionality, and Advanced properties of the MessageList component.
Please note that the Properties marked with the symbol are not accessible within the Configuration Object.Example
MessageListConfiguration
.
cometChatMessages.
If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.MessageComposerConfiguration
object.
MessageComposerConfiguration
provides access to all the Action, Filters, Styles, Functionality, and Advanced properties of the MessageComposer component.
Please note that the Properties marked with the symbol are not accessible within the Configuration Object.Example
MessageComposerConfiguration
.
cometChatMessages.
If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.ThreadedMessagesConfiguration
object.
ThreadedMessagesConfiguration
provides access to all the Action, Filters, Styles, Functionality, and Advanced properties of the ThreadedMessages component.
Please note that the Properties marked with the symbol are not accessible within the Configuration Object.Example
MessageListConfiguration
. We then apply these changes to the ThreadedMessages component using ThreadedMessagesConfiguration
.
cometChatMessages
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.