Skip to main content
CometChat Campaigns lets you deliver targeted, rich notifications to users via an in-app notification feed. Each notification is a Card Schema JSON — a structured layout rendered natively by the CometChat Cards library. The SDK provides APIs to fetch feed items, listen for real-time delivery, mark items as read/delivered, report engagement, and retrieve unread counts.
Before using the SDK, set up your channels, categories, templates, and campaigns in the CometChat Dashboard. See the Dashboard Setup Guide for step-by-step instructions.

Key Concepts


How Cards Render in the Notification Feed

Each NotificationFeedItem has a content field containing an object — this is the Card Schema JSON. This JSON is passed directly to the CometChat Cards renderer library (@cometchat/cards-react-native). The rendering flow:
  1. Fetch feed items via NotificationFeedRequestBuilder
  2. For each item, extract item.getContent() — this is the Card Schema JSON
  3. Convert to string: JSON.stringify(item.getContent())
  4. Pass to the Cards renderer (CometChatCardView)
  5. The renderer produces a native React Native view from the JSON

Card Schema JSON Structure

The body array contains elements (text, image, button, row, column, etc.) rendered top-to-bottom. Interactive elements like buttons emit actions via a callback — the consumer handles navigation, deep links, or API calls.

Retrieve Notification Feed Items

Use NotificationFeedRequestBuilder to fetch a paginated list of feed items. Uses cursor-based pagination internally.

Build the Request

Builder Parameters

Fetch Items

Call fetchNext() repeatedly for pagination. When the server has no more items, subsequent calls return an empty array.

NotificationFeedItem Fields


Retrieve Notification Categories

Use NotificationCategoriesRequestBuilder to fetch available categories for filter chips.

NotificationCategory Fields


Real-Time Notification Feed Listener

Listen for new feed items arriving via WebSocket. This listener is independent from MessageListener, GroupListener, and CallListener.
Remove the listener when no longer needed:

Mark Feed Item as Read

Mark a single item as read. Idempotent — safe to call multiple times.

Mark Feed Item as Delivered

Mark a single item as delivered. Idempotent.

Mark Multiple Items as Delivered (Batch)


Report Engagement

Report that a user engaged with a feed item (e.g., viewed, clicked, interacted). Idempotent.
The interactionString parameter is a free-form string describing the engagement (e.g., "viewed", "clicked", "interacted").

Get Unread Count

Fetch the total number of unread notification feed items.

Fetch Single Feed Item

Fetch a specific item by ID — useful for deep linking from push notifications.

Push Notification Tracking

When a campaign push notification arrives via FCM/APNs, use these methods to report delivery and click engagement.

Mark Push Notification as Delivered

Call this when the push notification is received:

Mark Push Notification as Clicked

Call this when the user taps the push notification:

PushNotification Fields


FeedReadState Enum


Rendering Cards

The content field of each NotificationFeedItem is a Card Schema JSON object. To render it natively, use the CometChat Cards library.

Add the Cards Dependency

If you’re using @cometchat/chat-uikit-react-native v5.3.6+, the cards library is included automatically as a dependency.

Render a Card from a Feed Item

The Cards library is a pure renderer — it does not execute actions. Your code must handle action callbacks (opening URLs, navigating to chats, making API calls, etc.).

Supported Card Actions

When a user taps a button or link inside a card, the action callback receives one of these action types:

Card Messages

Besides the notification feed, the same Card Schema JSON can arrive as a chat message. A CardMessage is a message with category: "card" — created and sent via the Platform (REST) API or the Dashboard Bubble Builder. The SDK only receives card messages; it does not send them. Card messages are delivered through the onCardMessageReceived callback of the MessageListener, not through the notification feed listener. The payload from getCard() is the same Card Schema JSON described above, so you render it with the same CometChatCardView and handle the same card actions.

CardMessage Fields

Card messages are receive-only. They are created and sent exclusively via the Platform (REST) API and Dashboard Bubble Builder. The SDK exposes the raw payload via getCard() — the CometChat Cards library is responsible for drawing the card UI.