Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
// Start typing indicator
let typing = TypingIndicator(receiverID: "UID", receiverType: .user)
CometChat.startTyping(indicator: typing)
// Stop typing indicator
CometChat.endTyping(indicator: typing)
// Listen for typing events
extension VC: CometChatMessageDelegate {
func onTypingStarted(_ typingDetails: TypingIndicator) { }
func onTypingEnded(_ typingDetails: TypingIndicator) { }
}
Send a Typing Indicator
Start Typing
Use startTyping() with a TypingIndicator object to notify the receiver that you’re typing.
Swift (User)
Objective-C (User)
Swift (Group)
let typingIndicator = TypingIndicator(receiverID: "cometchat-uid-2", receiverType: .user)
CometChat.startTyping(indicator: typingIndicator)
TypingIndicator *typingIndicator = [[TypingIndicator alloc]initWithReceiverID:@"cometchat-uid-2" receiverType:ReceiverTypeUser metadata:nil];
[CometChat startTypingWithIndicator:typingIndicator];
let typingIndicator = TypingIndicator(receiverID: "group-guid-1", receiverType: .group)
CometChat.startTyping(indicator: typingIndicator)
startTyping() returns void — the typing indicator is sent as a fire-and-forget operation.
Stop Typing
Use endTyping() to notify the receiver that you’ve stopped typing.
Swift (User)
Objective-C (User)
Swift (Group)
let typingIndicator = TypingIndicator(receiverID: "cometchat-uid-2", receiverType: .user)
CometChat.endTyping(indicator: typingIndicator)
TypingIndicator *typingIndicator = [[TypingIndicator alloc]initWithReceiverID:@"cometchat-uid-2" receiverType:ReceiverTypeUser metadata:nil];
[CometChat endTypingWithIndicator:typingIndicator];
let typingIndicator = TypingIndicator(receiverID: "group-guid-1", receiverType: .group)
CometChat.endTyping(indicator: typingIndicator)
endTyping() returns void — the typing indicator is sent as a fire-and-forget operation.
Use the metadata property of TypingIndicator to pass additional custom data. Retrieve it with metadata on the receiver side.
Real-time Typing Indicators
Use onTypingStarted and onTypingEnded in CometChatMessageDelegate to receive typing events.
extension YourViewController: CometChatMessageDelegate {
func onTypingStarted(_ typingDetails: TypingIndicator) {
print("User started typing")
print("Sender: \(typingDetails.sender?.name ?? "")")
print("Receiver ID: \(typingDetails.receiverID)")
print("Receiver Type: \(typingDetails.receiverType)")
}
func onTypingEnded(_ typingDetails: TypingIndicator) {
print("User stopped typing")
print("Sender: \(typingDetails.sender?.name ?? "")")
}
}
// Register the delegate:
CometChat.messagedelegate = self
@interface ViewController ()<CometChatMessageDelegate>
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
CometChat.messagedelegate = self;
}
- (void)onTypingStarted:(TypingIndicator *)typingDetails {
NSLog(@"Typing started received successfully");
}
- (void)onTypingEnded:(TypingIndicator *)typingDetails {
NSLog(@"Typing ended received successfully");
}
@end
The received TypingIndicator object contains:
| Property | Type | Description |
|---|
sender | User? | User object of the person typing |
receiverID | String | UID of user or GUID of group |
receiverType | ReceiverType | .user or .group |
metadata | [String: Any]? | Custom data sent with indicator |
Typing indicators are transient and not persisted. The receiver must be online to receive them.
Next Steps
Delivery & Read Receipts
Track when messages are delivered and read
Transient Messages
Send ephemeral real-time messages like live reactions