AI Integration Quick Reference
AI Integration Quick Reference
| Method | Description |
|---|---|
sendInteractiveMessage(message:) | Send an interactive message |
InteractiveMessage() | Create an interactive message object |
InteractionGoal() | Define completion criteria |
InteractiveMessage Properties
| Property | Type | Description |
|---|---|---|
| receiverUid | String | UID or GUID of recipient |
| receiverType | ReceiverType | .user or .group |
| type | String | form, card, scheduler, or custom |
| interactiveData | [String: Any] | JSON structure for content |
| allowSenderInteraction | Bool | Can sender interact (default: false) |
| interactionGoal | InteractionGoal | Completion criteria |
| messageCategory | MessageCategory | .interactive |
Interaction Goal Types
| Type | Description | Value |
|---|---|---|
| Any Action | Goal completed if any interaction occurs | .anyAction |
| Any Of | Goal achieved if any specified interaction occurs | .anyOf |
| All Of | Goal completed when all specified interactions occur | .allOf |
| None | Goal is never completed | .none |
Form Element Types
| Element Type | Description |
|---|---|
| textInput | Single or multi-line text input |
| dropdown | Dropdown select with options |
| checkbox | Multiple selection checkboxes |
| radio | Single selection radio buttons |
| singleSelect | Single selection list |
| button | Action button (submit, navigate) |
Button Action Types
| Action Type | Description |
|---|---|
| urlNavigation | Opens a URL in browser |
| apiAction | Makes an API call with specified parameters |
| customAction | Custom action handled by app |
Send Form Interactive Message
- Swift
Send Card Interactive Message
- Swift
Send Scheduler Interactive Message
- Swift
Send Form to Group
- Swift
Interaction Object Properties
| Property | Type | Description |
|---|---|---|
| elementId | String | ID of interacted element |
| interactedAt | Double | Timestamp of interaction |
InteractionGoal Object Properties
| Property | Type | Description |
|---|---|---|
| elementIds | [String] | IDs of target elements |
| interactionType | InteractionGoalType | .anyAction, .anyOf, .allOf, .none |
Real-time Interactive Message Events
To receive interactive message events, implementCometChatMessageDelegate:
- Swift
Next Steps
Send Messages
Send text, media, and custom messages
Receive Messages
Listen for incoming messages in real time
Reactions
Add emoji reactions to messages
Mentions
Mention specific users in messages