Skip to main content
A thread lets people reply to one message in a focused sub-conversation. The Kit gives you the pieces — a header that shows the parent message, a message list in thread mode and a composer that replies in the thread — and you put them on a screen of your own.

Overview

  • The message list raises a callback when someone taps N replies under a message or chooses Reply in thread from its menu.
  • Your thread screen shows the parent in CometChatThreadHeader, the replies in CometChatMessageList given the parent, and a CometChatMessageComposer given the parent’s id.
  • Replies, edits, reactions and receipts update live on both screens.

Prerequisites

  • The Kit is installed, initialised and a user is logged in — see Getting Started.
  • A chat screen that already shows CometChatMessageList for a user or a group.

Components

Integration Steps

Step 1: Open the thread from the message list

Handle the thread callback on the chat screen and navigate to your thread screen with the parent message.

Step 2: Build the thread screen

Show the list in thread mode, with the thread header and the composer replying in the thread as bars over it, hosted as Conversation List + Message View hosts the chat’s, so the rows pass under the bars. Pass the same user or group the chat uses: the list and the composer need the chat as well as the parent.
ChatView.swift
The thread header fetches nothing — hand it the parent you already hold. It is at most 250 pt tall (maxHeight); a taller parent scrolls inside it.

Step 3: Handle a blocked user

In a one-to-one thread, the composer stays on screen when you have blocked the other person. Put your own banner in its place:
See Block / Unblock User for the whole flow.

Thread Subscription

Following a thread is on by default. A user who follows a thread is notified of its replies; the server also subscribes people who start, reply in, or are mentioned in a thread. The Kit ships two controls for the same state, kept in sync:
  1. Subscribe to thread / Unsubscribe from thread in the message list’s long-press menu.
  2. A bell on the thread header’s reply bar.
Both go through CometChatThreadSubscription, so a change made in one place shows in the other, and in any control of yours that uses it.

Hide the menu option

Hear the bell, or hide it

The callback hears the new state once the server accepts it. A failed toggle shows a toast and calls nothing.

Your own control

Use CometChatThreadSubscription so your control follows the Kit’s rules — one toggle per thread at a time, and every surface updated at once:
toggle returns nil — and does nothing — while a toggle for the same thread is in flight or ran in the last 400 ms.
CometChatSession.initialize(appID:region:subscribePresenceForAllUsers:enableThreadSubscription:) turns the feature off app-wide. It is deprecated — passing true does nothing — and kept only as that opt-out; prefer hiding the two controls per screen.

Implementation Flow

  1. The user taps N replies or chooses Reply in thread.
  2. The list calls your handler with the parent message.
  3. Your thread screen shows the parent, the replies and a composer bound to the thread.
  4. A sent reply appears in the thread, the reply count goes up, and the sender now follows the thread.

Edge Cases

Feature Matrix

Next Steps

Thread Header

Every option of the parent-message strip

Message List

Thread mode, options and callbacks

Events

The thread family of events

All Guides

Browse the other guides