Skip to main content
The CometChatAIAssistanceChatHistory component displays past conversations between users and AI assistants. Users can review previous AI interactions and start new conversations.

Prerequisites

1

Install CometChat UI Kit

Add to your Podfile:
Run pod install
2

Enable AI Features

Go to CometChat Dashboard → AI → Enable AI features
3

Initialize CometChat


Basic Implementation

You must set either user or group. Without this, only a loading indicator will display.

Production-Ready Implementation

Complete implementation with all features:

Custom Views

Custom Loading View

Custom Empty State View

Custom Error State View


Filter Messages

Customize which messages are displayed:
These parameters are always overridden by the component:
  • uid / guid
  • types
  • categories

Embed in Your App

As a Tab

As a Button Action


API Reference

Properties

*Either user or group is required

Callbacks

Custom Views

Style Properties (AiAssistantChatHistoryStyle)


Common Patterns

Present AI Chat History from Profile

Show AI chat history when user taps a button in their profile:

Handle Message Selection from History

Navigate to the full conversation when a message is tapped:

Custom Date Formatting for AI History

Format dates to show relative time for recent conversations:

AI History as Tab in Main Navigation

Add AI chat history as a dedicated tab:

AI Features Overview

All AI features

Message List

Chat message display

Message Composer

Message input

Components Overview

All components