CometChatNotificationFeed shows the notifications your app has sent to the logged-in user:
campaigns, announcements, reminders, product cards. Each item is a card drawn from its Card
Schema, with its category and the time it was sent above it. Filter chips — “All” and one per
category — sit at the top, each with its unread count. Items are marked delivered when they load
and read after they have been on screen for a second; new items arrive live.

Where It Fits
Quick Start
- SwiftUI
- UIKit
Put it in a
NavigationStack — as a tab’s root, it needs nothing else:onItemClick receives the SDK’s NotificationFeedItem — its id, category, content
(the card), metadata and tags.A button inside a card calls onActionClick with the item and a dictionary: "type" is the
card action’s type (openUrl, chatWithUser, customCallback, …) and "elementId" the id of
the element that was tapped:"action" carries the card action itself, a CometChatCardAction (import CometChatCardsSwift):
an openUrl’s URL, a chatWithUser’s uid. Match it — if case .openUrl(let url, _) = action["action"] as? CometChatCardAction — to act on the button as the card describes it.Filtering Notifications
The chips are “All” and one per category the server returns, in its order. Tapping a chip loads that category’s items; the category labels above the cards are hidden while one is selected. Each chip’s badge is its unread count, shown as “99+” above 99. The “All” count refreshes every 30 seconds, and the first count arrives 30 seconds after the screen opens, so the badge reads nothing until then. A category’s count only moves as items arrive live and are read — it is not fetched. The request applies to “All”; a chip’s request uses the default page size and the chip’s category.- SwiftUI
- UIKit
Hide the chips:Narrow what “All” loads with your own request:
Read and Delivered
Every item that loads or arrives without a delivery time is reported delivered, once. An unread item that stays on screen for a second is reported read; the badges count it down. Scrolling it away before then does not count.Header
- SwiftUI
- UIKit
The title — “Notifications” — sits on the left of the navigation bar. Change it, replace it, or
hide it:The back button is off by default — the feed is usually a tab. Turn it on when you push it.
With no
onBackPress, it dismisses the screen:Actions and Events
Callback Methods
- SwiftUI
- UIKit
onError is called each time the error state appears — a failed first load or refresh.
SDK Events (Real-Time, Automatic)
New items arrive live and are added to the list; the badges follow as items are read.States
Functionality
- SwiftUI
- UIKit
Custom View Slots
Replace a state with your own view.- SwiftUI
- UIKit
The header and the three state views are initialiser arguments (
headerView, emptyStateView,
errorStateView, loadingStateView). The error view receives the exception and the retry
action:Common Patterns
List operations
- SwiftUI
- UIKit
List operations go through the store — see Store Access below.
Advanced Methods
Store Access
- SwiftUI
- UIKit
NotificationFeedStore loads and holds the feed. Pass your own to read its state — uiState,
feedItems, filterChips, totalUnreadCount — or to show fixed items in a preview:Subclassing
- SwiftUI
- UIKit
CometChatNotificationFeed is a View struct. Customise it with its slots and style.Accessibility
In the SwiftUI toolkit:- Each chip is a button with its unread count as its value; the active chip is selected.
- Each item is announced as “Notification from” its category; the card’s buttons stay reachable inside it.
- The empty and error art is decorative; their titles are headers.
Style
- SwiftUI
- UIKit
CometChatNotificationFeedStyle is sparse: set only what you change.Next Steps
Component Styling
Style every component
Extensions
Add features to your chat