@cometchat/skills 4.2.1 → 4.4.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.
- package/LICENSE +21 -0
- package/README.md +33 -12
- package/bin/install.js +59 -4
- package/package.json +14 -1
- package/skills/cometchat/SKILL.md +460 -77
- package/skills/cometchat/references/asking-questions.md +48 -0
- package/skills/cometchat-a11y/SKILL.md +3 -2
- package/skills/cometchat-android-v5/SKILL.md +2 -1
- package/skills/cometchat-android-v5-calls/SKILL.md +36 -22
- package/skills/cometchat-android-v5-calls/references/README.md +1 -1
- package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +7 -5
- package/skills/cometchat-android-v5-calls/references/audio-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/call-layouts.md +33 -25
- package/skills/cometchat-android-v5-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v5-calls/references/custom-ui.md +5 -5
- package/skills/cometchat-android-v5-calls/references/event-listeners.md +2 -2
- package/skills/cometchat-android-v5-calls/references/idle-timeout.md +20 -14
- package/skills/cometchat-android-v5-calls/references/in-call-chat.md +1 -1
- package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +43 -27
- package/skills/cometchat-android-v5-calls/references/participant-management.md +3 -3
- package/skills/cometchat-android-v5-calls/references/raise-hand.md +25 -19
- package/skills/cometchat-android-v5-calls/references/recording.md +2 -2
- package/skills/cometchat-android-v5-calls/references/ringing-integration.md +1 -1
- package/skills/cometchat-android-v5-calls/references/screen-sharing.md +5 -9
- package/skills/cometchat-android-v5-calls/references/session-settings.md +3 -3
- package/skills/cometchat-android-v5-calls/references/setup.md +1 -1
- package/skills/cometchat-android-v5-calls/references/share-invite.md +9 -4
- package/skills/cometchat-android-v5-calls/references/video-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/voip-calling.md +2 -2
- package/skills/cometchat-android-v5-components/SKILL.md +4 -3
- package/skills/cometchat-android-v5-core/SKILL.md +20 -2
- package/skills/cometchat-android-v5-customization/SKILL.md +171 -7
- package/skills/cometchat-android-v5-extensions/SKILL.md +7 -4
- package/skills/cometchat-android-v5-features/SKILL.md +5 -4
- package/skills/cometchat-android-v5-placement/SKILL.md +2 -1
- package/skills/cometchat-android-v5-production/SKILL.md +2 -1
- package/skills/cometchat-android-v5-push/SKILL.md +2 -3
- package/skills/cometchat-android-v5-testing/SKILL.md +2 -1
- package/skills/cometchat-android-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +3 -2
- package/skills/cometchat-android-v6/SKILL.md +2 -1
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +11 -7
- package/skills/cometchat-android-v6-calls/SKILL.md +79 -18
- package/skills/cometchat-android-v6-calls/references/advanced-features.md +87 -0
- package/skills/cometchat-android-v6-calls/references/call-layouts.md +24 -15
- package/skills/cometchat-android-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v6-calls/references/device-management.md +17 -16
- package/skills/cometchat-android-v6-calls/references/idle-timeout.md +7 -4
- package/skills/cometchat-android-v6-calls/references/in-call-chat.md +13 -8
- package/skills/cometchat-android-v6-calls/references/raise-hand.md +6 -4
- package/skills/cometchat-android-v6-compose-components/SKILL.md +52 -29
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +156 -1
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +129 -40
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +27 -1
- package/skills/cometchat-android-v6-core/SKILL.md +389 -9
- package/skills/cometchat-android-v6-events/SKILL.md +4 -1
- package/skills/cometchat-android-v6-extensions/SKILL.md +2 -1
- package/skills/cometchat-android-v6-features/SKILL.md +26 -2
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +31 -1
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +172 -1
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +20 -5
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +36 -5
- package/skills/cometchat-android-v6-migration/SKILL.md +44 -42
- package/skills/cometchat-android-v6-production/SKILL.md +6 -3
- package/skills/cometchat-android-v6-push/SKILL.md +43 -2
- package/skills/cometchat-android-v6-testing/SKILL.md +11 -8
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +26 -5
- package/skills/cometchat-angular-calls/SKILL.md +256 -389
- package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +3 -2
- package/skills/cometchat-angular-calls/references/call-layouts.md +29 -12
- package/skills/cometchat-angular-calls/references/call-session.md +2 -2
- package/skills/cometchat-angular-calls/references/custom-ui.md +18 -10
- package/skills/cometchat-angular-calls/references/device-management.md +53 -34
- package/skills/cometchat-angular-calls/references/group-calls.md +45 -24
- package/skills/cometchat-angular-calls/references/idle-timeout.md +31 -15
- package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +7 -6
- package/skills/cometchat-angular-calls/references/raise-hand.md +9 -4
- package/skills/cometchat-angular-calls/references/recording-screen-share.md +32 -39
- package/skills/cometchat-angular-calls/references/ringing-integration.md +3 -1
- package/skills/cometchat-angular-calls/references/share-invite.md +11 -5
- package/skills/cometchat-angular-calls/references/virtual-background.md +29 -0
- package/skills/cometchat-angular-components/SKILL.md +149 -620
- package/skills/cometchat-angular-core/SKILL.md +235 -293
- package/skills/cometchat-angular-customization/SKILL.md +415 -223
- package/skills/cometchat-angular-features/SKILL.md +216 -334
- package/skills/cometchat-angular-patterns/SKILL.md +168 -359
- package/skills/cometchat-angular-placement/SKILL.md +189 -560
- package/skills/cometchat-angular-production/SKILL.md +241 -92
- package/skills/cometchat-angular-push/SKILL.md +280 -294
- package/skills/cometchat-angular-testing/SKILL.md +430 -158
- package/skills/cometchat-angular-theming/SKILL.md +190 -265
- package/skills/cometchat-angular-troubleshooting/SKILL.md +192 -157
- package/skills/cometchat-astro-patterns/SKILL.md +22 -1
- package/skills/cometchat-calls/SKILL.md +25 -19
- package/skills/cometchat-calls/references/use-case-broadcast.md +15 -10
- package/skills/cometchat-calls/references/use-case-marketplace.md +2 -3
- package/skills/cometchat-calls/references/use-case-support.md +3 -4
- package/skills/cometchat-calls/references/use-case-team.md +23 -12
- package/skills/cometchat-calls/references/use-case-telehealth.md +3 -4
- package/skills/cometchat-components/SKILL.md +163 -25
- package/skills/cometchat-core/SKILL.md +412 -13
- package/skills/cometchat-customization/SKILL.md +50 -25
- package/skills/cometchat-features/SKILL.md +313 -34
- package/skills/cometchat-flutter-v5/SKILL.md +10 -4
- package/skills/cometchat-flutter-v5-calls/SKILL.md +188 -158
- package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +48 -24
- package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +20 -15
- package/skills/cometchat-flutter-v5-calls/references/call-session.md +100 -145
- package/skills/cometchat-flutter-v5-calls/references/device-management.md +12 -8
- package/skills/cometchat-flutter-v5-calls/references/group-calls.md +30 -36
- package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +15 -13
- package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +12 -9
- package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +115 -65
- package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +41 -30
- package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +17 -14
- package/skills/cometchat-flutter-v5-calls/references/share-invite.md +8 -2
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-core/SKILL.md +20 -2
- package/skills/cometchat-flutter-v5-customization/SKILL.md +136 -5
- package/skills/cometchat-flutter-v5-events/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-messages/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-production/SKILL.md +15 -6
- package/skills/cometchat-flutter-v5-push/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-testing/SKILL.md +17 -6
- package/skills/cometchat-flutter-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +7 -6
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6/SKILL.md +17 -16
- package/skills/cometchat-flutter-v6-calls/SKILL.md +78 -63
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +8 -6
- package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +89 -0
- package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +15 -12
- package/skills/cometchat-flutter-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-flutter-v6-calls/references/device-management.md +9 -3
- package/skills/cometchat-flutter-v6-calls/references/group-calls.md +10 -10
- package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +15 -7
- package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +6 -3
- package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +23 -16
- package/skills/cometchat-flutter-v6-components/SKILL.md +32 -11
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +39 -11
- package/skills/cometchat-flutter-v6-core/SKILL.md +348 -10
- package/skills/cometchat-flutter-v6-customization/SKILL.md +97 -25
- package/skills/cometchat-flutter-v6-events/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6-features/SKILL.md +15 -6
- package/skills/cometchat-flutter-v6-messages/SKILL.md +111 -60
- package/skills/cometchat-flutter-v6-migration/SKILL.md +18 -25
- package/skills/cometchat-flutter-v6-placement/SKILL.md +79 -50
- package/skills/cometchat-flutter-v6-production/SKILL.md +13 -12
- package/skills/cometchat-flutter-v6-push/SKILL.md +43 -21
- package/skills/cometchat-flutter-v6-testing/SKILL.md +6 -6
- package/skills/cometchat-flutter-v6-theming/SKILL.md +38 -5
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +182 -17
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +12 -4
- package/skills/cometchat-i18n/SKILL.md +139 -78
- package/skills/cometchat-ios/SKILL.md +4 -2
- package/skills/cometchat-ios-calls/SKILL.md +225 -95
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +11 -9
- package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +45 -0
- package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +6 -7
- package/skills/cometchat-ios-calls/references/call-layouts.md +31 -91
- package/skills/cometchat-ios-calls/references/call-session.md +51 -54
- package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +33 -29
- package/skills/cometchat-ios-calls/references/custom-ui.md +38 -38
- package/skills/cometchat-ios-calls/references/group-calls.md +33 -70
- package/skills/cometchat-ios-calls/references/idle-timeout.md +24 -25
- package/skills/cometchat-ios-calls/references/in-call-chat.md +19 -23
- package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +128 -70
- package/skills/cometchat-ios-calls/references/picture-in-picture.md +20 -20
- package/skills/cometchat-ios-calls/references/raise-hand.md +14 -227
- package/skills/cometchat-ios-calls/references/recording-screen-share.md +35 -122
- package/skills/cometchat-ios-calls/references/ringing-integration.md +17 -16
- package/skills/cometchat-ios-calls/references/share-invite.md +8 -12
- package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +4 -4
- package/skills/cometchat-ios-components/SKILL.md +200 -12
- package/skills/cometchat-ios-core/SKILL.md +281 -11
- package/skills/cometchat-ios-customization/SKILL.md +276 -110
- package/skills/cometchat-ios-features/SKILL.md +64 -36
- package/skills/cometchat-ios-placement/SKILL.md +15 -12
- package/skills/cometchat-ios-production/SKILL.md +12 -4
- package/skills/cometchat-ios-push/SKILL.md +53 -19
- package/skills/cometchat-ios-testing/SKILL.md +14 -9
- package/skills/cometchat-ios-theming/SKILL.md +39 -3
- package/skills/cometchat-ios-troubleshooting/SKILL.md +41 -21
- package/skills/cometchat-native-bare-patterns/SKILL.md +56 -18
- package/skills/cometchat-native-calls/SKILL.md +89 -19
- package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +2 -2
- package/skills/cometchat-native-calls/references/call-layouts.md +15 -14
- package/skills/cometchat-native-calls/references/call-session.md +2 -2
- package/skills/cometchat-native-calls/references/custom-ui.md +12 -8
- package/skills/cometchat-native-calls/references/device-management.md +53 -30
- package/skills/cometchat-native-calls/references/group-calls.md +35 -30
- package/skills/cometchat-native-calls/references/idle-timeout.md +6 -6
- package/skills/cometchat-native-calls/references/in-call-chat.md +10 -8
- package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +2 -2
- package/skills/cometchat-native-calls/references/raise-hand.md +15 -13
- package/skills/cometchat-native-calls/references/recording-screen-share.md +49 -170
- package/skills/cometchat-native-calls/references/share-invite.md +7 -5
- package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +4 -2
- package/skills/cometchat-native-components/SKILL.md +91 -57
- package/skills/cometchat-native-core/SKILL.md +281 -9
- package/skills/cometchat-native-customization/SKILL.md +150 -28
- package/skills/cometchat-native-expo-patterns/SKILL.md +77 -27
- package/skills/cometchat-native-features/SKILL.md +79 -49
- package/skills/cometchat-native-placement/SKILL.md +19 -10
- package/skills/cometchat-native-production/SKILL.md +9 -3
- package/skills/cometchat-native-push/SKILL.md +2 -1
- package/skills/cometchat-native-testing/SKILL.md +1 -2
- package/skills/cometchat-native-theming/SKILL.md +54 -29
- package/skills/cometchat-native-troubleshooting/SKILL.md +71 -3
- package/skills/cometchat-nextjs-patterns/SKILL.md +48 -6
- package/skills/cometchat-placement/SKILL.md +42 -3
- package/skills/cometchat-production/SKILL.md +12 -5
- package/skills/cometchat-react-calls/SKILL.md +220 -10
- package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +4 -3
- package/skills/cometchat-react-calls/references/call-layouts.md +5 -6
- package/skills/cometchat-react-calls/references/call-session.md +1 -1
- package/skills/cometchat-react-calls/references/custom-ui.md +61 -15
- package/skills/cometchat-react-calls/references/device-management.md +55 -51
- package/skills/cometchat-react-calls/references/group-calls.md +18 -23
- package/skills/cometchat-react-calls/references/idle-timeout.md +25 -12
- package/skills/cometchat-react-calls/references/in-call-chat.md +7 -7
- package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +9 -11
- package/skills/cometchat-react-calls/references/raise-hand.md +14 -14
- package/skills/cometchat-react-calls/references/recording-screen-share.md +39 -38
- package/skills/cometchat-react-calls/references/ringing-integration.md +2 -2
- package/skills/cometchat-react-calls/references/share-invite.md +4 -5
- package/skills/cometchat-react-calls/references/testing-calls-on-web.md +20 -2
- package/skills/cometchat-react-calls/references/virtual-background.md +32 -0
- package/skills/cometchat-react-patterns/SKILL.md +57 -4
- package/skills/cometchat-react-push/SKILL.md +258 -72
- package/skills/cometchat-react-router-patterns/SKILL.md +43 -4
- package/skills/cometchat-react-testing/SKILL.md +14 -5
- package/skills/cometchat-theming/SKILL.md +181 -18
- package/skills/cometchat-troubleshooting/SKILL.md +40 -20
|
@@ -3,17 +3,27 @@ name: cometchat-ios-features
|
|
|
3
3
|
description: "Feature catalog for CometChat iOS UI Kit — calls, reactions, polls, stickers, AI features, and extensions."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "CometChatUIKitSwift ^5; iOS 13+"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "chat cometchat ios features calls reactions polls ai stickers extensions"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** `CometChatUIKitSwift ~> 5` + `packages/registry/v6/features/catalog.json`. (Official docs linked below.) Verify symbols against the installed package/source before relying on them.
|
|
13
|
+
|
|
13
14
|
## Purpose
|
|
14
15
|
|
|
16
|
+
> **Canonical public feature-availability matrix:** [Features & Extensions Guide](https://www.cometchat.com/docs/fundamentals/features-and-extensions-guide) — the authoritative source for which integration method (UI Kit / UI Kit Builder / Widget Builder / SDK) supports each feature + dashboard setup + whether code is required. It **outranks the local `catalog.json` snapshot on conflict**; consult it (WebFetch or docs MCP) for any availability decision.
|
|
17
|
+
|
|
18
|
+
|
|
15
19
|
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
20
|
|
|
21
|
+
### Feature categories — what work each needs
|
|
22
|
+
|
|
23
|
+
Classify the feature by the product's 5-category "work needed" model before enabling: **Core (zero-setup)** — out of the box (typing, reactions) · **Builder-enabled** — Dashboard API + UI Kit Builder toggle (polls) · **Config-only** — Dashboard API, automatic (link preview) · **Config + settings** — Dashboard API + extra settings/keys, no code (smart replies) · **SDK-integrated** — Dashboard API + **custom client code** (Bitly). **Key rule:** only SDK-integrated features need client code, and **the implementation lives in the docs** — `cometchat features info <id> --json` shows what's needed (`auto_wired_in_uikit: false` ⇒ the toggle alone won't render it; fetch + adapt the doc code, don't hand-roll). Don't assume "enabled = visible" for dashboard extensions.
|
|
24
|
+
|
|
25
|
+
**Honest-automation boundary:** standard **extensions** (polls, stickers, link-preview, message-translation, etc.) are enabled with a real dashboard API call via `cometchat apply-feature <id> --app-id <your-app-id>` — never tell the user to toggle them manually. But **third-party dashboard-only features** (Giphy, Stipop, Tenor, Chatwoot, Intercom, Disappearing Messages, Message Shortcuts) return `manual-action-required`: they need *your* third-party credentials and **cannot be automated** — state that. **Call recording is a paid plan add-on** (contact CometChat support; no toggle/CLI) — never claim it was enabled (see §1 Voice & Video Calls).
|
|
26
|
+
|
|
17
27
|
---
|
|
18
28
|
|
|
19
29
|
## 1. Voice & Video Calls
|
|
@@ -24,12 +34,12 @@ Add the CometChat Calls SDK to your project:
|
|
|
24
34
|
|
|
25
35
|
**CocoaPods:**
|
|
26
36
|
```ruby
|
|
27
|
-
pod 'CometChatCallsSDK', '~>
|
|
37
|
+
pod 'CometChatCallsSDK', '~> 5.0'
|
|
28
38
|
```
|
|
29
39
|
|
|
30
40
|
**Swift Package Manager:**
|
|
31
41
|
```
|
|
32
|
-
https://github.com/cometchat/
|
|
42
|
+
https://github.com/cometchat/calls-sdk-ios
|
|
33
43
|
```
|
|
34
44
|
|
|
35
45
|
### Required Permissions
|
|
@@ -163,13 +173,14 @@ let callSettings = CallSettingsBuilder()
|
|
|
163
173
|
.setIsAudioOnly(false) // Video call
|
|
164
174
|
.setDefaultAudioMode("SPEAKER") // "SPEAKER" or "EARPIECE"
|
|
165
175
|
.setShowSwitchToVideoCall(true) // Allow switching to video
|
|
166
|
-
|
|
167
|
-
.
|
|
168
|
-
.
|
|
169
|
-
.
|
|
170
|
-
.
|
|
171
|
-
.
|
|
172
|
-
.
|
|
176
|
+
// Button visibility uses inverted setXxxButtonDisable(Bool), NOT setShowXxxButton:
|
|
177
|
+
.setEndCallButtonDisable(false)
|
|
178
|
+
.setMuteAudioButtonDisable(false)
|
|
179
|
+
.setPauseVideoButtonDisable(false)
|
|
180
|
+
.setSwitchCameraButtonDisable(false)
|
|
181
|
+
.setAudioModeButtonDisable(false)
|
|
182
|
+
.setStartAudioMuted(false) // not setStartWithAudioMuted
|
|
183
|
+
.setStartVideoMuted(false) // not setStartWithVideoMuted
|
|
173
184
|
.build()
|
|
174
185
|
|
|
175
186
|
let outgoingCall = CometChatOutgoingCall()
|
|
@@ -184,10 +195,11 @@ Display call history:
|
|
|
184
195
|
|
|
185
196
|
```swift
|
|
186
197
|
let callLogs = CometChatCallLogs()
|
|
187
|
-
callLogs.onItemClick
|
|
198
|
+
callLogs.set(onItemClick: { callLog in
|
|
188
199
|
// Handle call log tap - maybe initiate a new call
|
|
200
|
+
// (the closure receives the tapped call log as `Any`)
|
|
189
201
|
print("Call log tapped: \(callLog)")
|
|
190
|
-
}
|
|
202
|
+
})
|
|
191
203
|
navigationController?.pushViewController(callLogs, animated: true)
|
|
192
204
|
```
|
|
193
205
|
|
|
@@ -212,14 +224,18 @@ messageList.hideReactionOption = true
|
|
|
212
224
|
```swift
|
|
213
225
|
class ReactionListener: CometChatMessageEventListener {
|
|
214
226
|
|
|
227
|
+
// ReactionEvent.reaction is a `Reaction?` OBJECT, not a String. The
|
|
228
|
+
// emoji/uid/messageId live on that nested Reaction; the event itself
|
|
229
|
+
// carries parentMessageId/conversationId/receiverId (there is NO `message`
|
|
230
|
+
// or `reactedBy` property on ReactionEvent).
|
|
215
231
|
func onMessageReactionAdded(reactionEvent: ReactionEvent) {
|
|
216
|
-
print("Reaction added: \(reactionEvent.reaction ?? "")")
|
|
217
|
-
print("By user: \(reactionEvent.
|
|
218
|
-
print("On message: \(reactionEvent.
|
|
232
|
+
print("Reaction added: \(reactionEvent.reaction?.reaction ?? "")")
|
|
233
|
+
print("By user: \(reactionEvent.reaction?.uid ?? "")")
|
|
234
|
+
print("On message: \(reactionEvent.reaction?.messageId ?? 0)")
|
|
219
235
|
}
|
|
220
236
|
|
|
221
237
|
func onMessageReactionRemoved(reactionEvent: ReactionEvent) {
|
|
222
|
-
print("Reaction removed: \(reactionEvent.reaction ?? "")")
|
|
238
|
+
print("Reaction removed: \(reactionEvent.reaction?.reaction ?? "")")
|
|
223
239
|
}
|
|
224
240
|
}
|
|
225
241
|
|
|
@@ -262,15 +278,16 @@ let pollData: [String: Any] = [
|
|
|
262
278
|
]
|
|
263
279
|
|
|
264
280
|
// Create custom message with poll type
|
|
281
|
+
// CustomMessage has no customType: init — pass the type via the trailing type: label
|
|
265
282
|
let pollMessage = CustomMessage(
|
|
266
283
|
receiverUid: user.uid ?? "",
|
|
267
284
|
receiverType: .user,
|
|
268
|
-
|
|
269
|
-
|
|
285
|
+
customData: pollData,
|
|
286
|
+
type: "extension_poll"
|
|
270
287
|
)
|
|
271
288
|
|
|
272
289
|
CometChat.sendCustomMessage(message: pollMessage) { message in
|
|
273
|
-
print("Poll sent: \(message
|
|
290
|
+
print("Poll sent: \(message.id)")
|
|
274
291
|
} onError: { error in
|
|
275
292
|
print("Error: \(error?.errorDescription ?? "")")
|
|
276
293
|
}
|
|
@@ -279,14 +296,15 @@ CometChat.sendCustomMessage(message: pollMessage) { message in
|
|
|
279
296
|
### Poll Bubble Customization
|
|
280
297
|
|
|
281
298
|
```swift
|
|
282
|
-
// Polls
|
|
283
|
-
//
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
299
|
+
// Polls render via the `CometChatPollsBubble` view (note the plural — there is no
|
|
300
|
+
// `CometChatPollBubble`). Its `style` is an INSTANCE property of type `PollBubbleStyle`
|
|
301
|
+
// (NOT a static), so you cannot assign `CometChatPollsBubble.style.x = …`.
|
|
302
|
+
// To restyle the poll bubble, build a `PollBubbleStyle`, then apply it inside a custom
|
|
303
|
+
// message template's bubble view (see cometchat-ios-customization → message templates):
|
|
304
|
+
let pollStyle = PollBubbleStyle()
|
|
305
|
+
pollStyle.backgroundColor = .secondarySystemBackground
|
|
306
|
+
// …set the PollBubbleStyle properties you need, then pass the styled
|
|
307
|
+
// CometChatPollsBubble instance from your template's bubbleView closure.
|
|
290
308
|
```
|
|
291
309
|
|
|
292
310
|
---
|
|
@@ -397,8 +415,8 @@ Generates a summary of the conversation:
|
|
|
397
415
|
|
|
398
416
|
// Get conversation summary
|
|
399
417
|
CometChat.getConversationSummary(
|
|
400
|
-
|
|
401
|
-
|
|
418
|
+
receiverId: user.uid ?? "",
|
|
419
|
+
receiverType: .user
|
|
402
420
|
) { summary in
|
|
403
421
|
print("Summary: \(summary)")
|
|
404
422
|
} onError: { error in
|
|
@@ -479,12 +497,22 @@ cometchat apply-feature message-translation --app-id <your-app-id>
|
|
|
479
497
|
// Translation option appears in message menu when enabled
|
|
480
498
|
// Users can tap "Translate" to see the translated version
|
|
481
499
|
|
|
482
|
-
// Programmatic translation:
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
500
|
+
// Programmatic translation: there is NO `CometChat.translateMessage(...)`
|
|
501
|
+
// method. Message translation is an extension — invoke it via callExtension
|
|
502
|
+
// against the message-translation slug:
|
|
503
|
+
CometChat.callExtension(
|
|
504
|
+
slug: "message-translation",
|
|
505
|
+
type: .post,
|
|
506
|
+
endPoint: "v2/translate",
|
|
507
|
+
body: [
|
|
508
|
+
"msgId": textMessage.id,
|
|
509
|
+
"text": textMessage.text,
|
|
510
|
+
"languages": ["es"] // target languages
|
|
511
|
+
]
|
|
512
|
+
) { response in
|
|
513
|
+
// response is [String: Any]? — read the translated text from the
|
|
514
|
+
// extension payload (see the message-translation extension docs).
|
|
515
|
+
print("Translation response: \(response ?? [:])")
|
|
488
516
|
} onError: { error in
|
|
489
517
|
print("Error: \(error?.errorDescription ?? "")")
|
|
490
518
|
}
|
|
@@ -628,7 +656,7 @@ let messageComposer = CometChatMessageComposer()
|
|
|
628
656
|
messageComposer.set(user: user)
|
|
629
657
|
|
|
630
658
|
// Hide voice recording button
|
|
631
|
-
messageComposer.
|
|
659
|
+
messageComposer.hideVoiceRecordingButton = true
|
|
632
660
|
```
|
|
633
661
|
|
|
634
662
|
### Required Permission
|
|
@@ -3,13 +3,14 @@ name: cometchat-ios-placement
|
|
|
3
3
|
description: "WHERE to put CometChat in your iOS app — navigation patterns, tab bars, modals, and embedded views."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "CometChatUIKitSwift ^5; iOS 13+"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "chat cometchat ios placement navigation tabs modal patterns"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** `CometChatUIKitSwift ~> 5` view controllers + `docs/ui-kit/ios`. **Official docs:** https://www.cometchat.com/docs/ui-kit/ios/overview · **Docs MCP:** `claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp` (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.
|
|
13
|
+
|
|
13
14
|
## Purpose
|
|
14
15
|
|
|
15
16
|
This skill teaches WHERE to place CometChat components in your iOS app. It covers navigation patterns, tab bar integration, modal presentations, and embedded views for different use cases.
|
|
@@ -64,9 +65,9 @@ func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options conn
|
|
|
64
65
|
conversations.set(onItemClick: { [weak conversations] conversation, _ in
|
|
65
66
|
let messagesVC = MessagesVC() // your own VC composing CometChatMessageHeader + List + Composer; see cometchat-ios-components § 12
|
|
66
67
|
if let user = conversation.conversationWith as? User {
|
|
67
|
-
messagesVC.
|
|
68
|
+
messagesVC.user = user
|
|
68
69
|
} else if let group = conversation.conversationWith as? Group {
|
|
69
|
-
messagesVC.
|
|
70
|
+
messagesVC.group = group
|
|
70
71
|
}
|
|
71
72
|
conversations?.navigationController?.pushViewController(messagesVC, animated: true)
|
|
72
73
|
})
|
|
@@ -111,9 +112,9 @@ struct ConversationsListView: UIViewControllerRepresentable {
|
|
|
111
112
|
|
|
112
113
|
func makeUIViewController(context: Context) -> CometChatConversations {
|
|
113
114
|
let conversations = CometChatConversations()
|
|
114
|
-
conversations.onItemClick
|
|
115
|
+
conversations.set(onItemClick: { conversation, _ in
|
|
115
116
|
selectedConversation = conversation
|
|
116
|
-
}
|
|
117
|
+
})
|
|
117
118
|
return conversations
|
|
118
119
|
}
|
|
119
120
|
|
|
@@ -235,7 +236,7 @@ class MainTabBarController: UITabBarController {
|
|
|
235
236
|
|
|
236
237
|
private func openMessages(with user: User) {
|
|
237
238
|
let messagesVC = MessagesVC() // your own VC composing CometChatMessageHeader + List + Composer; see cometchat-ios-components § 12
|
|
238
|
-
messagesVC.
|
|
239
|
+
messagesVC.user = user
|
|
239
240
|
messagesVC.hidesBottomBarWhenPushed = true
|
|
240
241
|
|
|
241
242
|
if let navController = selectedViewController as? UINavigationController {
|
|
@@ -245,7 +246,7 @@ class MainTabBarController: UITabBarController {
|
|
|
245
246
|
|
|
246
247
|
private func openMessages(with group: Group) {
|
|
247
248
|
let messagesVC = MessagesVC() // your own VC composing CometChatMessageHeader + List + Composer; see cometchat-ios-components § 12
|
|
248
|
-
messagesVC.
|
|
249
|
+
messagesVC.group = group
|
|
249
250
|
messagesVC.hidesBottomBarWhenPushed = true
|
|
250
251
|
|
|
251
252
|
if let navController = selectedViewController as? UINavigationController {
|
|
@@ -348,7 +349,7 @@ class ProductDetailViewController: UIViewController {
|
|
|
348
349
|
|
|
349
350
|
DispatchQueue.main.async {
|
|
350
351
|
let messagesVC = MessagesVC() // your own VC composing CometChatMessageHeader + List + Composer; see cometchat-ios-components § 12
|
|
351
|
-
messagesVC.
|
|
352
|
+
messagesVC.user = user
|
|
352
353
|
|
|
353
354
|
let navController = UINavigationController(rootViewController: messagesVC)
|
|
354
355
|
navController.modalPresentationStyle = .pageSheet
|
|
@@ -536,9 +537,9 @@ class MainViewController: UIViewController {
|
|
|
536
537
|
conversations.set(onItemClick: { [weak self] conversation, _ in
|
|
537
538
|
let messagesVC = MessagesVC() // your own VC composing CometChatMessageHeader + List + Composer; see cometchat-ios-components § 12
|
|
538
539
|
if let user = conversation.conversationWith as? User {
|
|
539
|
-
messagesVC.
|
|
540
|
+
messagesVC.user = user
|
|
540
541
|
} else if let group = conversation.conversationWith as? Group {
|
|
541
|
-
messagesVC.
|
|
542
|
+
messagesVC.group = group
|
|
542
543
|
}
|
|
543
544
|
conversations.navigationController?.pushViewController(messagesVC, animated: true)
|
|
544
545
|
})
|
|
@@ -615,9 +616,9 @@ class ChatSplitViewController: UISplitViewController {
|
|
|
615
616
|
let messagesVC = MessagesVC() // your own VC composing CometChatMessageHeader + List + Composer; see cometchat-ios-components § 12
|
|
616
617
|
|
|
617
618
|
if let user = conversation.conversationWith as? User {
|
|
618
|
-
messagesVC.
|
|
619
|
+
messagesVC.user = user
|
|
619
620
|
} else if let group = conversation.conversationWith as? Group {
|
|
620
|
-
messagesVC.
|
|
621
|
+
messagesVC.group = group
|
|
621
622
|
}
|
|
622
623
|
|
|
623
624
|
let secondaryNav = UINavigationController(rootViewController: messagesVC)
|
|
@@ -729,7 +730,9 @@ class EmbeddedChatViewController: UIViewController {
|
|
|
729
730
|
DispatchQueue.main.async {
|
|
730
731
|
self?.supportUser = user
|
|
731
732
|
self?.messageList.set(user: user)
|
|
733
|
+
self?.messageList.set(controller: self) // mandatory — see cometchat-ios-components § 4/§ 6
|
|
732
734
|
self?.messageComposer.set(user: user)
|
|
735
|
+
self?.messageComposer.set(controller: self) // mandatory — enables attachments/sheets
|
|
733
736
|
}
|
|
734
737
|
} onError: { error in
|
|
735
738
|
print("Error: \(error?.errorDescription ?? "")")
|
|
@@ -3,13 +3,14 @@ name: cometchat-ios-production
|
|
|
3
3
|
description: "Production-ready CometChat iOS setup — server-side auth tokens, security best practices, and deployment checklist."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "CometChatUIKitSwift ^5; iOS 13+"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "chat cometchat ios production auth tokens security deployment"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** `CometChatUIKitSwift ~> 5` (+ `CometChatCallsSDK ~> 5`) — Pods/SPM `.swiftinterface` + `ui-kit/ios`. **Official docs:** https://www.cometchat.com/docs/fundamentals/user-auth · **Docs MCP:** `claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp` (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.
|
|
13
|
+
|
|
13
14
|
## Purpose
|
|
14
15
|
|
|
15
16
|
This skill teaches how to prepare your CometChat iOS integration for production. It covers replacing development Auth Keys with server-side auth tokens, security best practices, and a deployment checklist.
|
|
@@ -314,7 +315,9 @@ final class CometChatManager {
|
|
|
314
315
|
self?.currentUser = user
|
|
315
316
|
completion(.success(user))
|
|
316
317
|
case .onError(let error):
|
|
317
|
-
|
|
318
|
+
// CometChatException does NOT conform to Swift's Error, so it
|
|
319
|
+
// can't go straight into Result<_, Error> — bridge it.
|
|
320
|
+
completion(.failure(CometChatError.sdk(error)))
|
|
318
321
|
}
|
|
319
322
|
}
|
|
320
323
|
}
|
|
@@ -335,7 +338,9 @@ final class CometChatManager {
|
|
|
335
338
|
self?.currentUser = nil
|
|
336
339
|
completion(.success(()))
|
|
337
340
|
case .onError(let error):
|
|
338
|
-
|
|
341
|
+
// CometChatException does NOT conform to Swift's Error, so it
|
|
342
|
+
// can't go straight into Result<_, Error> — bridge it.
|
|
343
|
+
completion(.failure(CometChatError.sdk(error)))
|
|
339
344
|
}
|
|
340
345
|
}
|
|
341
346
|
}
|
|
@@ -349,7 +354,8 @@ enum CometChatError: LocalizedError {
|
|
|
349
354
|
case invalidURL
|
|
350
355
|
case noData
|
|
351
356
|
case invalidResponse
|
|
352
|
-
|
|
357
|
+
case sdk(CometChatException) // bridges a CometChatException into Swift's Error
|
|
358
|
+
|
|
353
359
|
var errorDescription: String? {
|
|
354
360
|
switch self {
|
|
355
361
|
case .notInitialized:
|
|
@@ -360,6 +366,8 @@ enum CometChatError: LocalizedError {
|
|
|
360
366
|
return "No data received from server"
|
|
361
367
|
case .invalidResponse:
|
|
362
368
|
return "Invalid response from server"
|
|
369
|
+
case .sdk(let exception):
|
|
370
|
+
return exception.errorDescription
|
|
363
371
|
}
|
|
364
372
|
}
|
|
365
373
|
}
|
|
@@ -3,13 +3,14 @@ name: cometchat-ios-push
|
|
|
3
3
|
description: "Set up push notifications for CometChat iOS apps — APNs configuration, token registration, and notification handling."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "CometChatUIKitSwift ^5; iOS 13+"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "chat cometchat ios push notifications apns"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** `CometChatUIKitSwift ~> 5` (+ `CometChatCallsSDK ~> 5`) — Pods/SPM `.swiftinterface` + `ui-kit/ios`. **Official docs:** https://www.cometchat.com/docs/notifications/overview · **Docs MCP:** `claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp` (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.
|
|
13
|
+
|
|
13
14
|
## Purpose
|
|
14
15
|
|
|
15
16
|
This skill teaches how to set up push notifications for CometChat iOS apps, including APNs configuration, token registration, and handling incoming notifications.
|
|
@@ -161,16 +162,50 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
private func registerPushToken(_ token: String) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
// CANONICAL v5 API: CometChatNotifications.registerPushToken takes a
|
|
166
|
+
// PushPlatforms enum (NOT a settings dict). Use .APNS_IOS_DEVICE for a
|
|
167
|
+
// standard APNs device token, .APNS_IOS_VOIP for a PushKit VoIP token,
|
|
168
|
+
// or .FCM_IOS if you route iOS through FCM. providerId is your dashboard
|
|
169
|
+
// push-provider id (pass nil to use the default).
|
|
170
|
+
CometChatNotifications.registerPushToken(
|
|
171
|
+
pushToken: token,
|
|
172
|
+
platform: .APNS_IOS_DEVICE,
|
|
173
|
+
providerId: nil
|
|
167
174
|
) { success in
|
|
168
175
|
print("Push token registered: \(success)")
|
|
169
176
|
} onError: { error in
|
|
170
|
-
print("Push token registration failed: \(error
|
|
177
|
+
print("Push token registration failed: \(error.errorDescription)")
|
|
171
178
|
}
|
|
179
|
+
// NOTE: the legacy `CometChat.registerTokenForPushNotification(token:settings:)`
|
|
180
|
+
// (v4-era) still compiles but is superseded — prefer the call above.
|
|
172
181
|
}
|
|
173
|
-
|
|
182
|
+
|
|
183
|
+
// MARK: - Token lifecycle (register AFTER login, unregister BEFORE logout)
|
|
184
|
+
//
|
|
185
|
+
// ⚠️ `didRegisterForRemoteNotifications` can fire before the user logs in.
|
|
186
|
+
// Registering a token that isn't bound to a CometChat session is a no-op at
|
|
187
|
+
// best. Stash the latest APNs token and register it only once login resolves:
|
|
188
|
+
//
|
|
189
|
+
// var pendingPushToken: String? // set in didRegisterForRemoteNotifications
|
|
190
|
+
// // after CometChatUIKit.login(...) onSuccess:
|
|
191
|
+
// if let t = pendingPushToken { registerPushToken(t) }
|
|
192
|
+
//
|
|
193
|
+
// And ALWAYS unregister before logout — otherwise the device keeps receiving
|
|
194
|
+
// pushes for the previous user:
|
|
195
|
+
|
|
196
|
+
func unregisterPushToken(_ completion: @escaping () -> Void) {
|
|
197
|
+
CometChatNotifications.unregisterPushToken { _ in
|
|
198
|
+
completion()
|
|
199
|
+
} onError: { _ in
|
|
200
|
+
completion() // proceed with logout regardless
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Usage at logout:
|
|
205
|
+
// unregisterPushToken {
|
|
206
|
+
// CometChatUIKit.logout(onSuccess: { _ in /* route to login */ }, onError: { _ in })
|
|
207
|
+
// }
|
|
208
|
+
|
|
174
209
|
// MARK: - Handle Incoming Notifications
|
|
175
210
|
|
|
176
211
|
func application(
|
|
@@ -348,14 +383,16 @@ extension AppDelegate: PKPushRegistryDelegate {
|
|
|
348
383
|
let token = pushCredentials.token.map { String(format: "%02.2hhx", $0) }.joined()
|
|
349
384
|
print("VoIP Token: \(token)")
|
|
350
385
|
|
|
351
|
-
// Register VoIP token with CometChat
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
386
|
+
// Register VoIP token with CometChat — canonical v5 API uses the
|
|
387
|
+
// .APNS_IOS_VOIP platform (NOT settings: ["voip": true]).
|
|
388
|
+
CometChatNotifications.registerPushToken(
|
|
389
|
+
pushToken: token,
|
|
390
|
+
platform: .APNS_IOS_VOIP,
|
|
391
|
+
providerId: nil
|
|
355
392
|
) { success in
|
|
356
393
|
print("VoIP token registered: \(success)")
|
|
357
394
|
} onError: { error in
|
|
358
|
-
print("VoIP token registration failed: \(error
|
|
395
|
+
print("VoIP token registration failed: \(error.errorDescription)")
|
|
359
396
|
}
|
|
360
397
|
}
|
|
361
398
|
|
|
@@ -511,17 +548,14 @@ UIApplication.shared.applicationIconBadgeNumber = 0
|
|
|
511
548
|
|
|
512
549
|
```swift
|
|
513
550
|
func updateBadgeCount() {
|
|
514
|
-
|
|
551
|
+
// getUnreadMessageCount's success closure receives a SINGLE [String: Any]
|
|
552
|
+
// (conversations keyed by uid/guid → count) — NOT two separate dicts.
|
|
553
|
+
CometChat.getUnreadMessageCount { unread in
|
|
515
554
|
var totalUnread = 0
|
|
516
|
-
|
|
517
|
-
for (_, count) in userUnread {
|
|
518
|
-
totalUnread += count as? Int ?? 0
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
for (_, count) in groupUnread {
|
|
555
|
+
for (_, count) in unread {
|
|
522
556
|
totalUnread += count as? Int ?? 0
|
|
523
557
|
}
|
|
524
|
-
|
|
558
|
+
|
|
525
559
|
DispatchQueue.main.async {
|
|
526
560
|
UIApplication.shared.applicationIconBadgeNumber = totalUnread
|
|
527
561
|
}
|
|
@@ -3,7 +3,6 @@ name: cometchat-ios-testing
|
|
|
3
3
|
description: Testing patterns for CometChat iOS UI Kit v5 in Swift / SwiftUI / UIKit projects. Covers XCTest setup, mocking CometChatSDK + CometChatUIKitSwift via protocols, snapshot testing with iOSSnapshotTestCase, async/await test helpers, UI testing for full chat flows on simulators, and CI on Xcode Cloud / GitHub Actions.
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Xcode 15+, Swift 5.9+, iOS 13+ deployment target; XCTest (built-in); SnapshotTesting >= 1.15 (Pointfree); CometChatUIKitSwift ~> 5.1"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list, ask-user"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "4.0.0"
|
|
@@ -19,7 +18,7 @@ Testing patterns for iOS CometChat integrations. XCTest (built-in) for unit + in
|
|
|
19
18
|
- `cometchat-ios-components` — what each VC does (tests assert against this)
|
|
20
19
|
- `cometchat-ios-calls/references/callkit-and-pushkit.md` — CallKit testing strategy (different from chat)
|
|
21
20
|
|
|
22
|
-
**Ground truth:**
|
|
21
|
+
**Ground truth:** **Official docs:** https://www.cometchat.com/docs/ui-kit/ios/overview · **Docs MCP:** `claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp` (or fetch the URL directly without MCP).
|
|
23
22
|
- XCTest — https://developer.apple.com/documentation/xctest
|
|
24
23
|
- SnapshotTesting — https://github.com/pointfreeco/swift-snapshot-testing
|
|
25
24
|
|
|
@@ -47,6 +46,10 @@ The CometChat SDKs are class-based with static methods (`CometChat.init`, `Comet
|
|
|
47
46
|
// Protocols/CometChatService.swift
|
|
48
47
|
import CometChatSDK
|
|
49
48
|
|
|
49
|
+
// CometChatException does NOT conform to Swift's Error, so a throwing
|
|
50
|
+
// continuation can't resume with it directly — bridge it through this.
|
|
51
|
+
struct CometChatTestError: Error { let message: String }
|
|
52
|
+
|
|
50
53
|
protocol CometChatServiceProtocol {
|
|
51
54
|
func initialize(appId: String, region: String) async throws
|
|
52
55
|
func login(uid: String, authKey: String) async throws -> User
|
|
@@ -63,16 +66,18 @@ final class CometChatService: CometChatServiceProtocol {
|
|
|
63
66
|
.subscribePresenceForAllUsers()
|
|
64
67
|
.setRegion(region: region)
|
|
65
68
|
.build()
|
|
66
|
-
CometChat.init(appId: appId, appSettings: settings
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
+
CometChat.init(appId: appId, appSettings: settings, onSuccess: { _ in
|
|
70
|
+
cont.resume()
|
|
71
|
+
}, onError: { error in
|
|
72
|
+
cont.resume(throwing: CometChatTestError(message: error.errorDescription))
|
|
73
|
+
})
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
func login(uid: String, authKey: String) async throws -> User {
|
|
73
78
|
try await withCheckedThrowingContinuation { (cont: CheckedContinuation<User, Error>) in
|
|
74
|
-
CometChat.login(UID: uid,
|
|
75
|
-
onError: { cont.resume(throwing: $0) })
|
|
79
|
+
CometChat.login(UID: uid, authKey: authKey, onSuccess: { cont.resume(returning: $0) },
|
|
80
|
+
onError: { cont.resume(throwing: CometChatTestError(message: $0.errorDescription)) })
|
|
76
81
|
}
|
|
77
82
|
}
|
|
78
83
|
|
|
@@ -238,8 +243,8 @@ final class ChatViewSnapshotTests: XCTestCase {
|
|
|
238
243
|
|
|
239
244
|
func testChatViewWithMessages() {
|
|
240
245
|
let messages = [
|
|
241
|
-
TextMessage(text: "Hi",
|
|
242
|
-
TextMessage(text: "Hey",
|
|
246
|
+
TextMessage(receiverUid: "alice", text: "Hi", receiverType: .user),
|
|
247
|
+
TextMessage(receiverUid: "bob", text: "Hey", receiverType: .user),
|
|
243
248
|
]
|
|
244
249
|
let view = ChatView(messages: messages)
|
|
245
250
|
let host = UIHostingController(rootView: view)
|
|
@@ -3,13 +3,14 @@ name: cometchat-ios-theming
|
|
|
3
3
|
description: "Customize the look and feel of CometChat iOS UI Kit — colors, fonts, styles, and dark mode support."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "CometChatUIKitSwift ^5; iOS 13+"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "chat cometchat ios theming colors fonts styles dark-mode"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** `CometChatUIKitSwift ~> 5` (+ `CometChatCallsSDK ~> 5`) — Pods/SPM `.swiftinterface` + `ui-kit/ios`. **Official docs:** https://www.cometchat.com/docs/ui-kit/ios/overview · **Docs MCP:** `claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp` (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.
|
|
13
|
+
|
|
13
14
|
## Purpose
|
|
14
15
|
|
|
15
16
|
This skill teaches how to customize the visual appearance of CometChat iOS UI Kit components. It covers global theming, component-level styling, dark mode support, and creating custom themes.
|
|
@@ -115,8 +116,22 @@ CometChatTheme.neutralColor900 = UIColor.black
|
|
|
115
116
|
```swift
|
|
116
117
|
import CometChatUIKitSwift
|
|
117
118
|
|
|
118
|
-
//
|
|
119
|
-
CometChatTypography.setFont(name:
|
|
119
|
+
// Two distinct font APIs exist (both verified against CometChatUIKitSwift):
|
|
120
|
+
// • `CometChatTypography.setFont(name: String)` — class func, sets ONE font
|
|
121
|
+
// family name globally (uikit.swiftinterface:11156).
|
|
122
|
+
// • `Typography.overrideFont(family: CometChatFontFamily)` — mutating instance
|
|
123
|
+
// method taking per-weight names (regular/medium/bold). Use this when your
|
|
124
|
+
// weights map to differently-named font files. (Typography.swift:108)
|
|
125
|
+
// The per-weight form is shown below; `CometChatTypography` itself is a static
|
|
126
|
+
// class with no default()/init.
|
|
127
|
+
var customTypography = Typography() // the mutable Typography struct (has overrideFont)
|
|
128
|
+
let avenirFamily = CometChatFontFamily(
|
|
129
|
+
regular: "Avenir",
|
|
130
|
+
medium: "Avenir-Medium",
|
|
131
|
+
bold: "Avenir-Heavy"
|
|
132
|
+
)
|
|
133
|
+
customTypography.overrideFont(family: avenirFamily)
|
|
134
|
+
// Apply via your CometChatTheme construction (see §1).
|
|
120
135
|
|
|
121
136
|
// Or customize individual text styles
|
|
122
137
|
CometChatTypography.Heading1.bold = UIFont.systemFont(ofSize: 28, weight: .bold)
|
|
@@ -620,6 +635,27 @@ extension UIColor {
|
|
|
620
635
|
|
|
621
636
|
---
|
|
622
637
|
|
|
638
|
+
## Localization
|
|
639
|
+
|
|
640
|
+
To translate the UI, switch the active language, or override individual strings, route to the dedicated **`cometchat-i18n`** skill — the canonical cross-family localization reference. iOS uses `CometChatLocalize` (see `cometchat-i18n` for the exact iOS signature). It covers bundled languages, custom translations, RTL, and date/time formatting. Docs: https://www.cometchat.com/docs/ui-kit/ios/localize
|
|
641
|
+
|
|
642
|
+
## Sound Manager — custom notification & call sounds
|
|
643
|
+
|
|
644
|
+
Sounds are a **behavioral** customization — driven by `CometChatSoundManager` (an instance class). The UI Kit plays the built-in cues automatically; use this to override a cue with your own audio file. (Docs: ui-kit/ios/sound-manager.)
|
|
645
|
+
|
|
646
|
+
```swift
|
|
647
|
+
// Play a default cue — Sound: .incomingMessage | .outgoingMessage | .incomingCall | .outgoingCall
|
|
648
|
+
CometChatSoundManager().play(sound: .incomingMessage)
|
|
649
|
+
|
|
650
|
+
// Override with a custom sound file (customSound: URL?)
|
|
651
|
+
if let url = Bundle.main.url(forResource: "ping", withExtension: "wav") {
|
|
652
|
+
CometChatSoundManager().play(sound: .incomingMessage, customSound: url)
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// Stop whatever is playing
|
|
656
|
+
CometChatSoundManager().pause()
|
|
657
|
+
```
|
|
658
|
+
|
|
623
659
|
## Best Practices
|
|
624
660
|
|
|
625
661
|
1. **Configure theme early** — Set theme in `application(_:didFinishLaunchingWithOptions:)` before any CometChat UI is shown
|