CometChat Campaigns enables you to send rich, interactive notifications to users through an in-app notification feed. Each notification is rendered as a native card using the CometChat Cards library — supporting images, text, buttons, layouts, and interactive actions.Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-eng-35741-widget-builder.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Before proceeding, ensure you have completed the UI Kit integration and the Dashboard Setup for Campaigns.
Overview
Campaigns delivers notifications as Card Schema JSON — a structured format that defines the visual layout of each notification card. The system consists of three layers:- CometChat Chat SDK — Fetches feed items, manages read/delivered state, provides real-time listeners, handles push notification tracking
- CometChat Cards Library — Renders Card Schema JSON into native UIKit views
- CometChat UI Kit — Provides the ready-to-use
CometChatNotificationFeedcomponent that wires everything together
Sending Campaigns
Before integrating the frontend, you need to set up channels, categories, templates, and campaigns in the CometChat Dashboard. Follow the Dashboard Setup Guide for step-by-step instructions with screenshots.How Cards Work
EachNotificationFeedItem from the SDK contains a content field — a [String: Any] dictionary holding the Card Schema JSON. This JSON is passed directly to the CometChat Cards renderer which produces a native UIKit view.
The Cards library is a pure renderer:
- Input: Card Schema JSON string + theme mode + optional action callback
- Output: Native UIKit view hierarchy
Card Schema JSON Example
Notification Feed Component
TheCometChatNotificationFeed component renders campaign notifications as a full-screen scrollable feed. It handles fetching, card rendering, pagination, filtering, real-time updates, and engagement reporting automatically.
- Swift
Setting Up Notification Service Extension
To track push notification delivery for campaigns, you need a Notification Service Extension. This runs when a push arrives on the device (even if the app is in the background).Step 1: Create the Extension
- In Xcode, go to File → New → Target.
- Select Notification Service Extension.
- Name it (e.g.,
NotificationService). - Click Finish.
Step 2: Configure App Groups
Both your main app and the extension need to share data via an App Group:- Select your main app target → Signing & Capabilities → + Capability → App Groups.
- Add a group (e.g.,
group.com.yourapp.cometchat). - Select your extension target → repeat the same steps with the same group ID.
Step 3: Add CometChatSDK to the Extension
AddCometChatSDK as a dependency to the extension target (via SPM or CocoaPods).
Step 4: Implement the Extension
- Swift
Handling Push Notification Clicks
When the user taps a campaign push notification, report the click and navigate to the feed:- Swift
Managing Campaigns
Campaigns are created and managed from the CometChat Dashboard or via the REST API. The SDK and UI Kit are consumer-side — they display and interact with campaigns, not create them.- Dashboard: Navigate to Campaigns → follow the flow above (Channel → Category → Template → Bubble Builder → Send).
- REST API: Use the Campaigns API to programmatically create and schedule campaigns.