AI Integration Quick Reference
AI Integration Quick Reference
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 callsonSearchClick.
- SwiftUI
- UIKit
ChatsWithSearch.swift
2. Handle a conversation result
A conversation result hands you theConversation. 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 theBaseMessage. Open its chat and jump to it:
- a group message’s chat is
message.receiveras aGroup; - a one-to-one message’s chat is the other person —
message.receiverwhen you sent it,message.senderotherwise; - a reply in a thread has a
parentMessageId; open the thread at the reply, or the chat at the parent.
- SwiftUI
- UIKit
ChatAtMessage.swift
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:- SwiftUI
- UIKit
5. Configure filters and scopes (optional)
- SwiftUI
- UIKit
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