CometChatNotificationFeed displays a scrollable notification feed where each item is rendered as a native card using the CometChat Cards library. It handles fetching, pagination, category filtering, real-time updates, and read/delivered/engagement reporting automatically. Present it in a UINavigationController, push it onto an existing navigation stack, or embed it in a tab bar.
Each notification gets its own section header with the category label on the left and a relative timestamp on the right:
| Condition | Display |
|---|---|
| Today (< 24 hours ago) | Time only — 2:35 PM |
| Yesterday (24–48 hours ago) | Yesterday |
| This week (2–7 days ago) | Day name — Monday, Tuesday, etc. |
| Older (> 7 days) | Full date — 25/05/2026 |
- Swift
Quick Start
- Swift
CometChatUIKit.init() and a user logged in.
Filtering Feed Items
Control what loads using custom request builders:- Swift
Filter Options
| Builder Method | Description |
|---|---|
.set(limit: Int) | Items per page (default 20). |
.set(readState: FeedReadState) | .read, .unread, or omit for all. |
.set(category: String) | Filter by category name. |
.set(categoryId: String) | Filter by category ID. |
.set(channelId: String) | Filter by channel. |
.set(tags: [String]) | Filter by tags. |
.set(dateFrom: String) | ISO 8601 date lower bound. |
.set(dateTo: String) | ISO 8601 date upper bound. |
.build(). The component calls .build() internally.
Actions and Events
onItemClick
Fires when a feed item card is tapped.- Swift
onActionClick
Fires when an interactive element (button, link) inside a card is tapped.- Swift
onError
Fires when an internal error occurs (network failure, SDK exception).- Swift
Automatic Behaviors
The component handles these automatically — no manual setup needed:| Behavior | Description |
|---|---|
| Real-time updates | New items appear at the top via WebSocket listener. |
| Delivery reporting | Items are reported as delivered when fetched. |
| Read reporting | Items are reported as read after 1 second of visibility. |
| Unread count polling | Polls unread count every 30 seconds to update badges. |
| Infinite scroll | Fetches next page when scrolling near the bottom. |
| Pull-to-refresh | Resets and fetches fresh data on pull. |
| Timestamp grouping | Groups items as “Today”, “Yesterday”, day name, or date. |
| Category filtering | Filter chips row for category-based filtering. |
| Connection recovery | Automatically refreshes when the app returns from background. |
Functionality
| Method | Description |
|---|---|
set(title: String) | Header title text. Default “Notifications”. |
set(showBackButton: Bool) | Toggle back button visibility. Default true. |
set(showFilterChips: Bool) | Toggle category filter chips. Default true. |
set(cardThemeMode: String) | Card rendering theme: “auto”, “light”, or “dark”. |
set(notificationFeedRequestBuilder:) | Custom feed request builder. |
set(notificationCategoriesRequestBuilder:) | Custom categories request builder. |
- Swift
Common Patterns
Show only unread items
- Swift
Hide filter chips
- Swift
Custom categories request
- Swift
Embed in a Tab Bar
- Swift
Handle action + report engagement
- Swift
Next Steps
| Topic | Description |
|---|---|
| Campaigns Feature | Overview of how campaigns work end-to-end. |
| SDK Campaigns API | Low-level SDK APIs for feed items, categories, and engagement. |