Quick Reference for AI Agents & Developers
- Send transient:
CometChat.sendTransientMessage(message:)— passTransientMessage(receiverID:receiverType:data:) - Receive transient:
onTransientMessageReceived(_:)in message listener delegate - Note: Transient messages are NOT saved — receiver must be online
- Use cases: Live location sharing, real-time indicators, ephemeral data
- Related: Send Message · Typing Indicators · Messaging Overview
Key Characteristics
| Characteristic | Description |
|---|---|
| Fire-and-forget | No success/failure callbacks |
| NOT persisted | Cannot be retrieved from history |
| Real-time only | Receiver must be online |
| No receipts | No delivery/read receipts |
Use Cases
| Use Case | Description |
|---|---|
| Live reactions | Heart, thumbs up, emoji animations |
| Live location | Real-time location sharing |
| Ephemeral indicators | Temporary status updates |
| Custom real-time data | Any data that doesn’t need persistence |
Send Transient Message (User)
- Swift
- Objective C
Sample Payloads - Transient Message (User)
Sample Payloads - Transient Message (User)
- Request
- Sent
Method:
CometChat.sendTransientMessage(message:)| Parameter | Type | Value |
|---|---|---|
| receiverID | String | "cometchat-uid-2" |
| receiverType | CometChat.ReceiverType | .user |
| data | [String: Any] | ["LIVE_REACTION": "heart", "timestamp": 1772028567.875231] |
Send Transient Message (Group)
- Swift
Sample Payloads - Transient Message (Group)
Sample Payloads - Transient Message (Group)
- Request
- Sent
Method:
CometChat.sendTransientMessage(message:)| Parameter | Type | Value |
|---|---|---|
| receiverID | String | "cometchat-guid-1" |
| receiverType | CometChat.ReceiverType | .group |
| data | [String: Any] | ["LIVE_REACTION": "thumbsup", "timestamp": 1772028570.0602489] |
Send Live Reaction
- Swift
Sample Payloads - Live Reaction
Sample Payloads - Live Reaction
- Request
- Sent
Method:
CometChat.sendTransientMessage(message:)| Parameter | Type | Value |
|---|---|---|
| receiverID | String | "cometchat-uid-2" |
| receiverType | CometChat.ReceiverType | .user |
| data.LIVE_REACTION | String | "heart" |
| data.type | String | "live_reaction" |
Common Live Reactions
| Reaction | Value |
|---|---|
| Heart | "heart" |
| Thumbs Up | "thumbsup" |
| Thumbs Down | "thumbsdown" |
| Laugh | "laugh" |
| Wow | "wow" |
| Sad | "sad" |
| Angry | "angry" |
Send Live Location
- Swift
Sample Payloads - Live Location
Sample Payloads - Live Location
- Request
- Sent
Method:
CometChat.sendTransientMessage(message:)| Parameter | Type | Value |
|---|---|---|
| receiverID | String | "cometchat-uid-2" |
| receiverType | CometChat.ReceiverType | .user |
| data.type | String | "live_location" |
| data.latitude | Double | 37.7749 |
| data.longitude | Double | -122.4194 |
| data.accuracy | Double | 10.0 |
| data.timestamp | Double | 1772028575.777206 |
Live Location Data Properties
| Property | Type | Description |
|---|---|---|
| type | String | "live_location" |
| latitude | Double | Latitude coordinate |
| longitude | Double | Longitude coordinate |
| accuracy | Double | Location accuracy in meters |
| timestamp | Double | Unix timestamp |
Real-time Transient Message Events
To receive transient messages, implementCometChatMessageDelegate:
- Swift
- Objective C
Sample Payloads - Receive Transient Message
Sample Payloads - Receive Transient Message
- Delegate Payload
Method:
onTransisentMessageReceived(_ message: TransientMessage)TransientMessage Object:| Parameter | Type | Value |
|---|---|---|
| sender.uid | String | "cometchat-uid-1" |
| sender.name | String | "John Doe" |
| receiverID | String | "cometchat-uid-2" |
| receiverType | ReceiverType | .user |
| data | [String: Any] | ["LIVE_REACTION": "heart"] |
TransientMessage Object Properties
| Property | Type | Description |
|---|---|---|
sender | User? | User who sent the transient message |
receiverID | String | UID of user or GUID of group |
receiverType | ReceiverType | .user or .group |
data | [String: Any] | Custom data dictionary |
Transient messages are NOT persisted and cannot be retrieved later. The receiver must be online to receive them. There are no delivery/read receipts for transient messages.