@cometchat/skills 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -17
  3. package/bin/install.js +389 -43
  4. package/package.json +19 -9
  5. package/skills/cometchat/SKILL.md +1066 -265
  6. package/skills/cometchat-android-v5/SKILL.md +120 -0
  7. package/skills/cometchat-android-v5-components/SKILL.md +430 -0
  8. package/skills/cometchat-android-v5-core/SKILL.md +468 -0
  9. package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
  10. package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
  11. package/skills/cometchat-android-v5-features/SKILL.md +130 -0
  12. package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
  13. package/skills/cometchat-android-v5-production/SKILL.md +94 -0
  14. package/skills/cometchat-android-v5-push/SKILL.md +620 -0
  15. package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
  16. package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
  17. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
  18. package/skills/cometchat-android-v6/SKILL.md +107 -0
  19. package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
  20. package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
  21. package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
  22. package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
  23. package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
  24. package/skills/cometchat-android-v6-core/SKILL.md +354 -0
  25. package/skills/cometchat-android-v6-events/SKILL.md +212 -0
  26. package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
  27. package/skills/cometchat-android-v6-features/SKILL.md +130 -0
  28. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
  29. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
  30. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
  31. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
  32. package/skills/cometchat-android-v6-production/SKILL.md +187 -0
  33. package/skills/cometchat-android-v6-push/SKILL.md +274 -0
  34. package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
  35. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
  36. package/skills/cometchat-angular-components/SKILL.md +706 -0
  37. package/skills/cometchat-angular-core/SKILL.md +444 -0
  38. package/skills/cometchat-angular-customization/SKILL.md +424 -0
  39. package/skills/cometchat-angular-features/SKILL.md +447 -0
  40. package/skills/cometchat-angular-patterns/SKILL.md +447 -0
  41. package/skills/cometchat-angular-placement/SKILL.md +685 -0
  42. package/skills/cometchat-angular-production/SKILL.md +415 -0
  43. package/skills/cometchat-angular-theming/SKILL.md +365 -0
  44. package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
  45. package/skills/cometchat-astro-patterns/SKILL.md +3 -3
  46. package/skills/cometchat-components/SKILL.md +11 -0
  47. package/skills/cometchat-core/SKILL.md +11 -6
  48. package/skills/cometchat-customization/references/component-catalog.md +1 -1
  49. package/skills/cometchat-features/SKILL.md +176 -108
  50. package/skills/cometchat-flutter-v5/SKILL.md +167 -0
  51. package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
  52. package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
  53. package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
  54. package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
  55. package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
  56. package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
  57. package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
  58. package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
  59. package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
  60. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
  61. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
  62. package/skills/cometchat-flutter-v6/SKILL.md +445 -0
  63. package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
  64. package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
  65. package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
  66. package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
  67. package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
  68. package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
  69. package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
  70. package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
  71. package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
  72. package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
  73. package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
  74. package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
  75. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
  76. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
  77. package/skills/cometchat-ios/SKILL.md +323 -0
  78. package/skills/cometchat-ios-components/SKILL.md +651 -0
  79. package/skills/cometchat-ios-core/SKILL.md +822 -0
  80. package/skills/cometchat-ios-customization/SKILL.md +825 -0
  81. package/skills/cometchat-ios-features/SKILL.md +725 -0
  82. package/skills/cometchat-ios-placement/SKILL.md +750 -0
  83. package/skills/cometchat-ios-production/SKILL.md +730 -0
  84. package/skills/cometchat-ios-push/SKILL.md +582 -0
  85. package/skills/cometchat-ios-theming/SKILL.md +631 -0
  86. package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
  87. package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
  88. package/skills/cometchat-native-components/SKILL.md +594 -0
  89. package/skills/cometchat-native-core/SKILL.md +407 -0
  90. package/skills/cometchat-native-customization/SKILL.md +594 -0
  91. package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
  92. package/skills/cometchat-native-features/SKILL.md +608 -0
  93. package/skills/cometchat-native-placement/SKILL.md +500 -0
  94. package/skills/cometchat-native-production/SKILL.md +694 -0
  95. package/skills/cometchat-native-push/SKILL.md +593 -0
  96. package/skills/cometchat-native-testing/SKILL.md +583 -0
  97. package/skills/cometchat-native-theming/SKILL.md +656 -0
  98. package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
  99. package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
  100. package/skills/cometchat-production/SKILL.md +60 -0
  101. package/skills/cometchat-react-router-patterns/SKILL.md +23 -21
@@ -0,0 +1,725 @@
1
+ ---
2
+ name: cometchat-ios-features
3
+ description: "Feature catalog for CometChat iOS UI Kit — calls, reactions, polls, stickers, AI features, and extensions."
4
+ license: "MIT"
5
+ compatibility: "CometChatUIKitSwift ^5; iOS 13+"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "chat cometchat ios features calls reactions polls ai stickers extensions"
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ This skill documents all features available in CometChat iOS UI Kit v5 — voice/video calls, reactions, polls, stickers, AI features, and extensions. Use this to understand what's available and how to enable/configure each feature.
16
+
17
+ ---
18
+
19
+ ## 1. Voice & Video Calls
20
+
21
+ ### Prerequisites
22
+
23
+ Add the CometChat Calls SDK to your project:
24
+
25
+ **CocoaPods:**
26
+ ```ruby
27
+ pod 'CometChatCallsSDK', '~> 4.0'
28
+ ```
29
+
30
+ **Swift Package Manager:**
31
+ ```
32
+ https://github.com/cometchat/cometchat-calls-sdk-ios
33
+ ```
34
+
35
+ ### Required Permissions
36
+
37
+ Add to `Info.plist`:
38
+ ```xml
39
+ <key>NSCameraUsageDescription</key>
40
+ <string>Camera access is required for video calls</string>
41
+ <key>NSMicrophoneUsageDescription</key>
42
+ <string>Microphone access is required for voice and video calls</string>
43
+ ```
44
+
45
+ ### Enable Background Modes
46
+
47
+ In Xcode → Target → Signing & Capabilities → Background Modes:
48
+ - ✅ Audio, AirPlay, and Picture in Picture
49
+ - ✅ Voice over IP
50
+
51
+ ### Call Buttons
52
+
53
+ Add call buttons to your message header:
54
+
55
+ ```swift
56
+ let messageHeader = CometChatMessageHeader()
57
+ messageHeader.set(user: user)
58
+
59
+ // Call buttons are shown by default when CometChatCallsSDK is available
60
+ // To hide them:
61
+ messageHeader.hideVideoCallButton = true
62
+ messageHeader.hideVoiceCallButton = true
63
+ ```
64
+
65
+ ### Standalone Call Buttons
66
+
67
+ ```swift
68
+ // CometChatCallButtons requires explicit width/height at init — no zero-arg init.
69
+ let callButtons = CometChatCallButtons(width: 80, height: 32)
70
+ callButtons.set(user: user)
71
+
72
+ // Or for group calls
73
+ callButtons.set(group: group)
74
+
75
+ // Customize
76
+ callButtons.hideVideoCallButton = false
77
+ callButtons.hideVoiceCallButton = false
78
+ ```
79
+
80
+ ### Initiating Calls Programmatically
81
+
82
+ ```swift
83
+ import CometChatSDK
84
+
85
+ // Voice call to user
86
+ let call = Call(receiverId: user.uid ?? "", callType: .audio, receiverType: .user)
87
+ CometChat.initiateCall(call: call) { call in
88
+ print("Call initiated: \(call?.sessionID ?? "")")
89
+ } onError: { error in
90
+ print("Error: \(error?.errorDescription ?? "")")
91
+ }
92
+
93
+ // Video call to user
94
+ let videoCall = Call(receiverId: user.uid ?? "", callType: .video, receiverType: .user)
95
+ CometChat.initiateCall(call: videoCall) { call in
96
+ print("Video call initiated")
97
+ } onError: { error in
98
+ print("Error: \(error?.errorDescription ?? "")")
99
+ }
100
+
101
+ // Group call
102
+ let groupCall = Call(receiverId: group.guid ?? "", callType: .video, receiverType: .group)
103
+ CometChat.initiateCall(call: groupCall) { call in
104
+ print("Group call initiated")
105
+ } onError: { error in
106
+ print("Error: \(error?.errorDescription ?? "")")
107
+ }
108
+ ```
109
+
110
+ ### Handling Incoming Calls
111
+
112
+ CometChat UI Kit automatically handles incoming calls when properly configured. The `CometChatIncomingCall` view controller is presented automatically.
113
+
114
+ For custom handling:
115
+
116
+ ```swift
117
+ import CometChatSDK
118
+
119
+ class CallListener: CometChatCallDelegate {
120
+
121
+ func onIncomingCallReceived(incomingCall: Call?, error: CometChatException?) {
122
+ guard let call = incomingCall else { return }
123
+
124
+ DispatchQueue.main.async {
125
+ let incomingCallVC = CometChatIncomingCall()
126
+ incomingCallVC.set(call: call)
127
+ incomingCallVC.modalPresentationStyle = .fullScreen
128
+
129
+ // Present from root view controller
130
+ UIApplication.shared.windows.first?.rootViewController?.present(
131
+ incomingCallVC,
132
+ animated: true
133
+ )
134
+ }
135
+ }
136
+
137
+ func onOutgoingCallAccepted(acceptedCall: Call?, error: CometChatException?) {
138
+ print("Call accepted")
139
+ }
140
+
141
+ func onOutgoingCallRejected(rejectedCall: Call?, error: CometChatException?) {
142
+ print("Call rejected")
143
+ }
144
+
145
+ func onIncomingCallCancelled(canceledCall: Call?, error: CometChatException?) {
146
+ print("Call cancelled")
147
+ }
148
+ }
149
+
150
+ // Register listener
151
+ CometChat.addCallListener("call-listener", CallListener())
152
+ ```
153
+
154
+ ### Call Settings Builder
155
+
156
+ Customize call behavior:
157
+
158
+ ```swift
159
+ #if canImport(CometChatCallsSDK)
160
+ import CometChatCallsSDK
161
+
162
+ let callSettings = CallSettingsBuilder()
163
+ .setIsAudioOnly(false) // Video call
164
+ .setDefaultAudioMode("SPEAKER") // "SPEAKER" or "EARPIECE"
165
+ .setShowSwitchToVideoCall(true) // Allow switching to video
166
+ .setShowEndCallButton(true)
167
+ .setShowMuteAudioButton(true)
168
+ .setShowPauseVideoButton(true)
169
+ .setShowSwitchCameraButton(true)
170
+ .setShowAudioModeButton(true)
171
+ .setStartWithAudioMuted(false)
172
+ .setStartWithVideoMuted(false)
173
+ .build()
174
+
175
+ let outgoingCall = CometChatOutgoingCall()
176
+ outgoingCall.set(call: call)
177
+ outgoingCall.set(callSettingsBuilder: callSettings)
178
+ #endif
179
+ ```
180
+
181
+ ### Call Logs
182
+
183
+ Display call history:
184
+
185
+ ```swift
186
+ let callLogs = CometChatCallLogs()
187
+ callLogs.onItemClick = { callLog, indexPath in
188
+ // Handle call log tap - maybe initiate a new call
189
+ print("Call log tapped: \(callLog)")
190
+ }
191
+ navigationController?.pushViewController(callLogs, animated: true)
192
+ ```
193
+
194
+ ---
195
+
196
+ ## 2. Message Reactions
197
+
198
+ Reactions are enabled by default in CometChat UI Kit v5.
199
+
200
+ ### Enable/Disable Reactions
201
+
202
+ ```swift
203
+ let messageList = CometChatMessageList()
204
+ messageList.set(user: user)
205
+
206
+ // Hide reaction option from message menu
207
+ messageList.hideReactionOption = true
208
+ ```
209
+
210
+ ### Reaction Events
211
+
212
+ ```swift
213
+ class ReactionListener: CometChatMessageEventListener {
214
+
215
+ func onMessageReactionAdded(reactionEvent: ReactionEvent) {
216
+ print("Reaction added: \(reactionEvent.reaction ?? "")")
217
+ print("By user: \(reactionEvent.reactedBy?.name ?? "")")
218
+ print("On message: \(reactionEvent.message?.id ?? 0)")
219
+ }
220
+
221
+ func onMessageReactionRemoved(reactionEvent: ReactionEvent) {
222
+ print("Reaction removed: \(reactionEvent.reaction ?? "")")
223
+ }
224
+ }
225
+
226
+ CometChatMessageEvents.addListener("reaction-listener", ReactionListener())
227
+ ```
228
+
229
+ ### Custom Reaction Set
230
+
231
+ ```swift
232
+ // Configure available reactions
233
+ let messageList = CometChatMessageList()
234
+
235
+ // The reaction set is configured through the data source
236
+ // See cometchat-ios-customization skill for DataSource customization
237
+ ```
238
+
239
+ ---
240
+
241
+ ## 3. Polls
242
+
243
+ Polls allow users to create and vote on questions.
244
+
245
+ ### Enable Polls Extension
246
+
247
+ ```bash
248
+ cometchat apply-feature polls --app-id <your-app-id>
249
+ ```
250
+
251
+ Once enabled, the poll creation option appears in the attachment menu.
252
+
253
+ ### Create Poll Programmatically
254
+
255
+ ```swift
256
+ import CometChatSDK
257
+
258
+ // Create poll data
259
+ let pollData: [String: Any] = [
260
+ "question": "What's your favorite programming language?",
261
+ "options": ["Swift", "Kotlin", "JavaScript", "Python"]
262
+ ]
263
+
264
+ // Create custom message with poll type
265
+ let pollMessage = CustomMessage(
266
+ receiverUid: user.uid ?? "",
267
+ receiverType: .user,
268
+ customType: "extension_poll",
269
+ customData: pollData
270
+ )
271
+
272
+ CometChat.sendCustomMessage(message: pollMessage) { message in
273
+ print("Poll sent: \(message?.id ?? 0)")
274
+ } onError: { error in
275
+ print("Error: \(error?.errorDescription ?? "")")
276
+ }
277
+ ```
278
+
279
+ ### Poll Bubble Customization
280
+
281
+ ```swift
282
+ // Polls are rendered using CometChatPollBubble
283
+ // Style customization:
284
+ CometChatPollBubble.style.backgroundColor = .secondarySystemBackground
285
+ CometChatPollBubble.style.questionTextColor = .label
286
+ CometChatPollBubble.style.questionTextFont = CometChatTypography.Heading4.medium
287
+ CometChatPollBubble.style.optionTextColor = .label
288
+ CometChatPollBubble.style.optionTextFont = CometChatTypography.Body.regular
289
+ CometChatPollBubble.style.voteCountTextColor = .secondaryLabel
290
+ ```
291
+
292
+ ---
293
+
294
+ ## 4. Stickers
295
+
296
+ Stickers provide a fun way to express emotions.
297
+
298
+ ### Enable Stickers
299
+
300
+ ```bash
301
+ cometchat apply-feature stickers --app-id <your-app-id>
302
+ ```
303
+
304
+ Once enabled, the sticker button appears in the message composer.
305
+
306
+ ### Hide Stickers
307
+
308
+ ```swift
309
+ let messageComposer = CometChatMessageComposer()
310
+ messageComposer.set(user: user)
311
+ messageComposer.hideStickersButton = true
312
+ ```
313
+
314
+ ### Custom Sticker Packs
315
+
316
+ Sticker packs are managed through the CometChat Dashboard:
317
+ 1. Go to CometChat Dashboard
318
+ 2. Navigate to Extensions → Stickers
319
+ 3. Add custom sticker packs
320
+
321
+ ---
322
+
323
+ ## 5. AI Features
324
+
325
+ CometChat provides AI-powered features for enhanced chat experiences.
326
+
327
+ ### Prerequisites — enable each AI feature via the CLI
328
+
329
+ iOS projects don't run `cometchat apply` (no `.cometchat/state.json`), so call the CLI in stateless mode with `--app-id`. AI features need an OpenAI key the first time:
330
+
331
+ ```bash
332
+ cometchat apply-feature smart-replies --app-id <your-app-id> --openai-key sk-...
333
+ cometchat apply-feature conversation-summary --app-id <your-app-id>
334
+ cometchat apply-feature conversation-starter --app-id <your-app-id>
335
+ ```
336
+
337
+ The OpenAI key is stored on the app once. Subsequent ai-feature applies don't need `--openai-key` repeated. Requires `cometchat auth login` once per machine.
338
+
339
+ Get an OpenAI key at https://platform.openai.com/api-keys.
340
+ 4. Configure your AI provider (OpenAI, etc.)
341
+
342
+ ### AI Conversation Starter
343
+
344
+ Suggests conversation starters for new chats:
345
+
346
+ ```swift
347
+ let conversationStarter = CometChatAIConversationStarter()
348
+
349
+ // Set AI message options
350
+ conversationStarter.set(aiMessageOptions: [
351
+ "How can I help you today?",
352
+ "What brings you here?",
353
+ "Tell me about your project"
354
+ ])
355
+
356
+ // Handle selection
357
+ conversationStarter.onMessageClicked { selectedReply in
358
+ print("Selected: \(selectedReply)")
359
+ // Send the selected message
360
+ }
361
+
362
+ // Show loading state
363
+ conversationStarter.showLoadingView()
364
+
365
+ // Hide loading state
366
+ conversationStarter.hideLoadingView()
367
+
368
+ // Show error state
369
+ conversationStarter.show(error: true)
370
+ ```
371
+
372
+ ### AI Smart Replies
373
+
374
+ Suggests quick replies based on conversation context:
375
+
376
+ ```swift
377
+ // Smart replies are automatically shown in the message composer
378
+ // when enabled in the dashboard
379
+
380
+ // To customize the smart replies view:
381
+ let messageComposer = CometChatMessageComposer()
382
+ messageComposer.set(user: user)
383
+
384
+ // Smart replies appear above the composer when available
385
+ ```
386
+
387
+ ### AI Conversation Summary
388
+
389
+ Generates a summary of the conversation:
390
+
391
+ ```swift
392
+ // Conversation summary is available through the AI extension
393
+ // Enable in CometChat Dashboard → AI → Conversation Summary
394
+
395
+ // The summary can be accessed through the message header menu
396
+ // or programmatically:
397
+
398
+ // Get conversation summary
399
+ CometChat.getConversationSummary(
400
+ conversationWith: user.uid ?? "",
401
+ conversationType: .user
402
+ ) { summary in
403
+ print("Summary: \(summary)")
404
+ } onError: { error in
405
+ print("Error: \(error?.errorDescription ?? "")")
406
+ }
407
+ ```
408
+
409
+ ### AI Assistant / Bot
410
+
411
+ Create AI-powered chat bots:
412
+
413
+ ```swift
414
+ // AI Bots are configured in CometChat Dashboard
415
+ // They appear as regular users in the chat
416
+
417
+ // To start a conversation with an AI bot:
418
+ let botUID = "ai-assistant" // Your bot's UID from dashboard
419
+
420
+ CometChat.getUser(UID: botUID) { bot in
421
+ guard let bot = bot else { return }
422
+
423
+ let messagesVC = MessagesVC() // your own VC composing CometChatMessageHeader + List + Composer
424
+ messagesVC.set(user: bot)
425
+ // Present the messages view
426
+ } onError: { error in
427
+ print("Error: \(error?.errorDescription ?? "")")
428
+ }
429
+ ```
430
+
431
+ ### AI Assistant Bubble Style
432
+
433
+ ```swift
434
+ CometChatAIAssistantBubble.style.backgroundColor = .secondarySystemBackground
435
+ CometChatAIAssistantBubble.style.textColor = .label
436
+ CometChatAIAssistantBubble.style.textFont = CometChatTypography.Body.regular
437
+ CometChatAIAssistantBubble.style.borderColor = .separator
438
+ CometChatAIAssistantBubble.style.borderWidth = 1
439
+ CometChatAIAssistantBubble.style.cornerRadius = CometChatCornerStyle(cornerRadius: 12)
440
+ ```
441
+
442
+ ---
443
+
444
+ ## 6. Link Preview
445
+
446
+ Automatically generates previews for URLs shared in messages.
447
+
448
+ ### Enable/Disable Link Preview
449
+
450
+ Link preview is enabled by default.
451
+
452
+ ```swift
453
+ // Link previews are handled automatically
454
+ // No additional configuration needed
455
+ ```
456
+
457
+ ### Link Preview Style
458
+
459
+ ```swift
460
+ // Customize link preview appearance
461
+ // Link previews use the standard message bubble styling
462
+ ```
463
+
464
+ ---
465
+
466
+ ## 7. Message Translation
467
+
468
+ Translate messages to different languages.
469
+
470
+ ### Enable Translation
471
+
472
+ ```bash
473
+ cometchat apply-feature message-translation --app-id <your-app-id>
474
+ ```
475
+
476
+ ### Translate a Message
477
+
478
+ ```swift
479
+ // Translation option appears in message menu when enabled
480
+ // Users can tap "Translate" to see the translated version
481
+
482
+ // Programmatic translation:
483
+ CometChat.translateMessage(
484
+ message: textMessage,
485
+ targetLanguage: "es" // Spanish
486
+ ) { translatedMessage in
487
+ print("Translated: \(translatedMessage.text ?? "")")
488
+ } onError: { error in
489
+ print("Error: \(error?.errorDescription ?? "")")
490
+ }
491
+ ```
492
+
493
+ ---
494
+
495
+ ## 8. Collaborative Features
496
+
497
+ ### Collaborative Whiteboard
498
+
499
+ Real-time whiteboard for drawing and collaboration:
500
+
501
+ ```bash
502
+ # Enable Collaborative Whiteboard via CLI:
503
+ cometchat apply-feature collaborative-whiteboard --app-id <your-app-id>
504
+ ```
505
+
506
+ ```swift
507
+ // Whiteboard option appears in attachment menu
508
+ // Opens a shared whiteboard session
509
+ ```
510
+
511
+ ### Collaborative Document
512
+
513
+ Real-time document editing:
514
+
515
+ ```bash
516
+ # Enable Collaborative Document via CLI:
517
+ cometchat apply-feature collaborative-document --app-id <your-app-id>
518
+ ```
519
+
520
+ ```swift
521
+ // Document option appears in attachment menu
522
+ // Opens a shared document session
523
+ ```
524
+
525
+ ---
526
+
527
+ ## 9. Typing Indicators
528
+
529
+ Show when users are typing.
530
+
531
+ ### Enable/Disable Typing Indicators
532
+
533
+ ```swift
534
+ let messageComposer = CometChatMessageComposer()
535
+ messageComposer.set(user: user)
536
+
537
+ // Disable sending typing events
538
+ messageComposer.disableTypingEvents = true
539
+
540
+ // Typing indicators in message list
541
+ let messageList = CometChatMessageList()
542
+ messageList.set(user: user)
543
+ // Typing indicators are shown automatically
544
+ ```
545
+
546
+ ### Listen for Typing Events
547
+
548
+ ```swift
549
+ class TypingListener: CometChatMessageDelegate {
550
+
551
+ func onTypingStarted(_ typingIndicator: TypingIndicator) {
552
+ print("\(typingIndicator.sender?.name ?? "") is typing...")
553
+ }
554
+
555
+ func onTypingEnded(_ typingIndicator: TypingIndicator) {
556
+ print("\(typingIndicator.sender?.name ?? "") stopped typing")
557
+ }
558
+ }
559
+
560
+ CometChat.addMessageListener("typing-listener", TypingListener())
561
+ ```
562
+
563
+ ---
564
+
565
+ ## 10. Read Receipts
566
+
567
+ Show message delivery and read status.
568
+
569
+ ### Enable/Disable Read Receipts
570
+
571
+ ```swift
572
+ let messageList = CometChatMessageList()
573
+ messageList.set(user: user)
574
+
575
+ // Hide read receipts
576
+ messageList.hideReceipts = true
577
+
578
+ // In conversations list
579
+ let conversations = CometChatConversations()
580
+ conversations.hideReceipts = true
581
+ ```
582
+
583
+ ### Receipt Status
584
+
585
+ - **Sent** — Message sent to server
586
+ - **Delivered** — Message delivered to recipient's device
587
+ - **Read** — Message read by recipient
588
+
589
+ ---
590
+
591
+ ## 11. Threaded Messages
592
+
593
+ Reply to specific messages in threads.
594
+
595
+ ### Enable/Disable Threads
596
+
597
+ ```swift
598
+ let messageList = CometChatMessageList()
599
+ messageList.set(user: user)
600
+
601
+ // Hide thread reply option
602
+ messageList.hideReplyInThreadOption = true
603
+ ```
604
+
605
+ ### Open Thread View
606
+
607
+ ```swift
608
+ // Thread replies are handled automatically
609
+ // Tapping "Reply in thread" opens the thread view
610
+
611
+ // Programmatic thread access:
612
+ messageList.onThreadRepliesClick = { message, template in
613
+ // Custom thread handling
614
+ print("Thread for message: \(message.id)")
615
+ }
616
+ ```
617
+
618
+ ---
619
+
620
+ ## 12. Voice Recording
621
+
622
+ Record and send voice messages.
623
+
624
+ ### Enable/Disable Voice Recording
625
+
626
+ ```swift
627
+ let messageComposer = CometChatMessageComposer()
628
+ messageComposer.set(user: user)
629
+
630
+ // Hide voice recording button
631
+ messageComposer.hideVoiceRecording = true
632
+ ```
633
+
634
+ ### Required Permission
635
+
636
+ Add to `Info.plist`:
637
+ ```xml
638
+ <key>NSMicrophoneUsageDescription</key>
639
+ <string>Microphone access is required for voice messages</string>
640
+ ```
641
+
642
+ ---
643
+
644
+ ## 13. Live Reactions
645
+
646
+ Send animated reactions that appear on screen. Live reactions are enabled by default and handled automatically by the SDK.
647
+
648
+ ### Listen for Live Reactions
649
+
650
+ ```swift
651
+ class LiveReactionListener: CometChatMessageEventListener {
652
+
653
+ func ccLiveReaction(reaction: TransientMessage) {
654
+ print("Live reaction received: \(reaction.data)")
655
+ // Show animation on screen
656
+ }
657
+ }
658
+
659
+ CometChatMessageEvents.addListener("live-reaction-listener", LiveReactionListener())
660
+ ```
661
+
662
+ ---
663
+
664
+ ## 14. Profanity Filter / Data Masking
665
+
666
+ Filter inappropriate content and mask sensitive data.
667
+
668
+ ### Enable in Dashboard
669
+
670
+ 1. Go to CometChat Dashboard
671
+ 2. Navigate to Extensions → Profanity Filter
672
+ 3. Configure blocked words and masking rules
673
+
674
+ ### How It Works
675
+
676
+ - Messages containing blocked words are automatically filtered
677
+ - Sensitive data (credit cards, SSN, etc.) can be masked
678
+ - Works on both sent and received messages
679
+
680
+ ---
681
+
682
+ ## 15. Thumbnail Generation
683
+
684
+ Automatically generates thumbnails for images and videos.
685
+
686
+ ### How It Works
687
+
688
+ - Thumbnails are generated automatically for media messages
689
+ - Displayed in conversation list and message list
690
+ - Full media loads on tap
691
+
692
+ ---
693
+
694
+ ## Feature Availability Matrix
695
+
696
+ | Feature | Requires SDK | Dashboard Config | Default |
697
+ |---|---|---|---|
698
+ | Voice/Video Calls | CometChatCallsSDK | No | Enabled* |
699
+ | Reactions | No | No | Enabled |
700
+ | Polls | No | Yes | Enabled |
701
+ | Stickers | No | Yes | Enabled |
702
+ | AI Features | No | Yes | Disabled |
703
+ | Link Preview | No | Yes | Enabled |
704
+ | Translation | No | Yes | Disabled |
705
+ | Whiteboard | No | Yes | Disabled |
706
+ | Collaborative Doc | No | Yes | Disabled |
707
+ | Typing Indicators | No | No | Enabled |
708
+ | Read Receipts | No | No | Enabled |
709
+ | Threaded Messages | No | No | Enabled |
710
+ | Voice Recording | No | No | Enabled |
711
+ | Live Reactions | No | No | Enabled |
712
+ | Profanity Filter | No | Yes | Disabled |
713
+
714
+ *Calls require CometChatCallsSDK to be installed
715
+
716
+ ---
717
+
718
+ ## Best Practices
719
+
720
+ 1. **Enable only needed features** — Disable unused features to reduce complexity
721
+ 2. **Configure in Dashboard first** — Most features require Dashboard configuration
722
+ 3. **Test on real devices** — Calls and voice recording require physical devices
723
+ 4. **Handle permissions gracefully** — Request permissions before using camera/microphone
724
+ 5. **Monitor usage** — AI features may have usage limits based on your plan
725
+