CometChatFlagMessage is the dialog a user reports a message with: a title with a close
button, a description, your app’s flag reasons as chips, an optional remark, and Cancel
/ Report, centred over a 40 % scrim. The message list
opens it from the Report option on someone else’s message. You can also present it
yourself.

Where It Fits
- SwiftUI
- UIKit
Quick Start
- SwiftUI
- UIKit
CometChatFlagMessage is a View. Present it full screen over a clear background. With no
onReportClick, the dialog flags the message itself, closes through onDismiss when that
succeeds and shows its error line when it fails:onCloseClick (the X) and onDismiss (a tap on the scrim, or a successful report) fall
back to onCancelClick. A tap on the scrim does nothing unless dismissOnClickOutside is
true.What It Shows
The
spam, sexual and harassment reasons read “Spam / Unwanted Content”, “Sexual
Content” and “Harassment / Bullying”. Other reasons show the name your dashboard gives
them. While the reasons load, or if fetching them fails, there are no chips and Report
cannot be tapped.
- SwiftUI
- UIKit
Hide the remark and its title with The five texts can be replaced with
showRemarkField: false. Translate or rename any reason
with localizationMap, keyed by the reason’s id in lower case:title, description, remarkHint,
cancelButtonText and reportButtonText. An empty string shows an empty line..glass (the default) and
Reduce Transparency is off. Everywhere else, including iOS 18–25, it is an opaque card.
- SwiftUI
- UIKit
The scrim, the 18 pt corners and everything inside the card are the same on both:
Actions and Events
Callback Methods
- SwiftUI
- UIKit
To flag the message yourself, take the SDK’s
FlagDetail from onReportClick and drive
the dialog’s spinner and error line:Functionality
- SwiftUI
- UIKit
Reasons are fetched every time the dialog opens.
Custom View Slots
- SwiftUI
- UIKit
Replace the title line, the chips, the remark or the buttons, for every flag-message dialog
in a subtree — the list’s included. Each closure gets the values the default region uses:The reasons view gets the reasons, the selected id and
onSelect(id); the remark view a
Binding<String>. Without onSelect, nothing can be selected and Report stays
disabled. The modifiers are cometChatFlagMessageTitleView,
cometChatFlagMessageReasonsView, cometChatFlagMessageRemarkView and
cometChatFlagMessageFooterView.Advanced Methods
Store Access
- SwiftUI
- UIKit
CometChatFlagMessageStore fetches the reasons and holds the selection and the remark.
Pass your own to preview the dialog without a session:Subclassing
- SwiftUI
- UIKit
CometChatFlagMessage is a View struct. Customise it with its parameters, slot modifiers
and style.Objective-C
In the UIKit toolkit: The dialog,FlagMessageStyle and the delegate are @objc. set(reasons:),
flagReasonLocalizer, set(store:) and the closure setters are Swift-only — the SDK’s
FlagReason and FlagDetail are not visible to Objective-C:
Accessibility
In the SwiftUI toolkit:- The card reads as “Flag Message Dialog” and is modal: VoiceOver does not read the chat behind it. The X reads as “Close”.
- Each chip is a button, marked selected when it is. Report keeps its label while the spinner shows.
- The error line is announced when it appears.
Style
- SwiftUI
- UIKit
CometChatFlagMessageStyle is sparse: set only what you change, and everything else
follows the theme. backgroundColor and borderRadius apply only to the opaque card.cancelButtonDisabledBackgroundColor and cancelButtonDisabledTextColor have no effect:
Cancel is never disabled.Next Steps
Message List
Presents the dialog from the Report option
Theming
The tokens the dialog’s defaults come from