Skip to main content
CometChatSearch searches the user’s conversations and messages as they type, with filter chips for unread chats, groups, photos, videos, links, documents and audio. You open it from the conversations list, or scope it to one chat from that chat’s header, and route the result the user taps.

Components

Integration Steps

1. Open search from the conversations list

The conversations list’s search field does not filter the list; it calls onSearchClick.
ChatsWithSearch.swift

2. Handle a conversation result

A conversation result hands you the Conversation. Its conversationWith is the User or the Group — open your chat screen with it, as a tap in the conversations list does.

3. Handle a message result

A message result hands you the BaseMessage. Open its chat and jump to it:
  • a group message’s chat is message.receiver as a Group;
  • a one-to-one message’s chat is the other person — message.receiver when you sent it, message.sender otherwise;
  • a reply in a thread has a parentMessageId; open the thread at the reply, or the chat at the parent.
ChatAtMessage.swift
Host the header and the composer over the list as Conversation List + Message View shows.

4. Scope search to one chat (optional)

Pass the chat’s user or group and the search covers only its messages. Open it from the chat’s header menu:
A hit in the chat that opened the search should take the user back there and jump the list to the message, rather than open the chat a second time.

5. Configure filters and scopes (optional)

conversationsRequestBuilder: and messagesRequestBuilder: narrow the requests further — see Search.

Feature Matrix

Next Steps

Search

Every option of the search screen

Conversations

The list search opens from

Threaded Messages

Open a thread at a reply

All Guides

Browse the other guides