@cometchat/skills 4.3.0 → 4.4.1
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/bin/install.js +27 -0
- package/package.json +14 -1
- package/skills/cometchat/SKILL.md +233 -69
- 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 +5 -3
- 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 +208 -28
- 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 +232 -312
- 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 +3 -2
- 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 +258 -20
- package/skills/cometchat-customization/SKILL.md +50 -25
- package/skills/cometchat-features/SKILL.md +314 -35
- 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 +5 -4
- 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 +72 -57
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +5 -3
- 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 +182 -21
- 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 +41 -19
- package/skills/cometchat-flutter-v6-testing/SKILL.md +4 -4
- 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 +140 -79
- 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 +173 -45
- 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 +36 -19
- package/skills/cometchat-native-calls/SKILL.md +29 -17
- 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 +84 -52
- package/skills/cometchat-native-core/SKILL.md +102 -33
- package/skills/cometchat-native-customization/SKILL.md +150 -28
- package/skills/cometchat-native-expo-patterns/SKILL.md +60 -29
- package/skills/cometchat-native-features/SKILL.md +24 -17
- 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 +11 -5
- package/skills/cometchat-nextjs-patterns/SKILL.md +22 -8
- 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 +45 -5
- package/skills/cometchat-react-push/SKILL.md +258 -72
- package/skills/cometchat-react-router-patterns/SKILL.md +12 -6
- 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,13 +3,14 @@ name: cometchat-ios-troubleshooting
|
|
|
3
3
|
description: "Diagnose and fix common CometChat iOS integration issues — build errors, runtime errors, and debugging techniques."
|
|
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 troubleshooting debugging errors fixes"
|
|
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 helps diagnose and fix common issues when integrating CometChat iOS UI Kit. It covers build errors, runtime errors, and debugging techniques.
|
|
@@ -76,7 +77,7 @@ pod 'CometChatSDK', '~> 4.0' # Add explicitly if needed
|
|
|
76
77
|
1. **If you need calls:**
|
|
77
78
|
```ruby
|
|
78
79
|
# Podfile
|
|
79
|
-
pod 'CometChatCallsSDK', '~>
|
|
80
|
+
pod 'CometChatCallsSDK', '~> 5.0'
|
|
80
81
|
```
|
|
81
82
|
|
|
82
83
|
2. **If you don't need calls:**
|
|
@@ -116,6 +117,7 @@ case .onError(let error):
|
|
|
116
117
|
**Solution:** `CometChatException` does NOT conform to Swift's `Error` protocol. Don't use `Result<T, Error>` with CometChat callbacks. Instead, use direct callbacks:
|
|
117
118
|
|
|
118
119
|
```swift
|
|
120
|
+
// tier2-expect-error — this block intentionally demonstrates the compile error below
|
|
119
121
|
// ❌ WRONG - Don't use Result<T, Error>
|
|
120
122
|
func login(completion: @escaping (Result<User, Error>) -> Void) {
|
|
121
123
|
CometChatUIKit.login(uid: uid) { result in
|
|
@@ -182,7 +184,7 @@ See `cometchat-ios-components` § 13 ("Custom MessagesVC Implementation") for th
|
|
|
182
184
|
1. **Install the Calls SDK:**
|
|
183
185
|
```ruby
|
|
184
186
|
# Podfile
|
|
185
|
-
pod 'CometChatCallsSDK', '~>
|
|
187
|
+
pod 'CometChatCallsSDK', '~> 5.0'
|
|
186
188
|
```
|
|
187
189
|
|
|
188
190
|
2. **Or wrap in conditional compilation:**
|
|
@@ -413,12 +415,12 @@ if let user = CometChatUIKit.getLoggedInUser() {
|
|
|
413
415
|
3. **Check for errors:**
|
|
414
416
|
```swift
|
|
415
417
|
let conversations = CometChatConversations()
|
|
416
|
-
conversations.onError
|
|
418
|
+
conversations.set(onError: { error in
|
|
417
419
|
print("Error loading conversations: \(error.errorDescription ?? "")")
|
|
418
|
-
}
|
|
419
|
-
conversations.onEmpty
|
|
420
|
+
})
|
|
421
|
+
conversations.set(onEmpty: {
|
|
420
422
|
print("No conversations found")
|
|
421
|
-
}
|
|
423
|
+
})
|
|
422
424
|
```
|
|
423
425
|
|
|
424
426
|
---
|
|
@@ -437,9 +439,9 @@ composer.set(user: user) // Must be set!
|
|
|
437
439
|
|
|
438
440
|
2. **Check for errors:**
|
|
439
441
|
```swift
|
|
440
|
-
composer.onError
|
|
441
|
-
print("Composer error: \(error
|
|
442
|
-
}
|
|
442
|
+
composer.set(onError: { error in
|
|
443
|
+
print("Composer error: \((error as? CometChatException)?.errorDescription ?? "")")
|
|
444
|
+
})
|
|
443
445
|
```
|
|
444
446
|
|
|
445
447
|
3. **Verify network connection:**
|
|
@@ -503,7 +505,7 @@ func application(_ application: UIApplication, didRegisterForRemoteNotifications
|
|
|
503
505
|
|
|
504
506
|
1. **CometChatCallsSDK installed?**
|
|
505
507
|
```ruby
|
|
506
|
-
pod 'CometChatCallsSDK', '~>
|
|
508
|
+
pod 'CometChatCallsSDK', '~> 5.0'
|
|
507
509
|
```
|
|
508
510
|
|
|
509
511
|
2. **Permissions in Info.plist?**
|
|
@@ -520,6 +522,16 @@ pod 'CometChatCallsSDK', '~> 4.0'
|
|
|
520
522
|
|
|
521
523
|
4. **Testing on real device?** Calls don't work on simulator
|
|
522
524
|
|
|
525
|
+
5. **Did you call `CometChatCalls.login(...)`?** ⚠️ **On iOS there is NO `CometChatCalls.login`** — the iOS `CometChatCallsSDK` has no `login`/`joinSession`/`SessionSettingsBuilder`. The authority is the vendored `CometChatCallsSDK.swiftinterface` (`generateToken` / `startSession` / `CallSettingsBuilder` / `CallsEventsDelegate`). The `calls-sdk-ios` repo's own `skills/` describe a *different* API and will mislead you — don't follow them. Default calling works through the UI Kit (`CometChatUIKit` calling-enabled) without a separate calls login; for custom calling, use `generateToken` → `startSession`.
|
|
526
|
+
|
|
527
|
+
### Background push for calls not arriving (Privacy manifest / APNs vs FCM)
|
|
528
|
+
|
|
529
|
+
**Cause:** Missing privacy manifest, or an APNs-vs-FCM provider mismatch.
|
|
530
|
+
|
|
531
|
+
**Fix:**
|
|
532
|
+
- Add a **`PrivacyInfo.xcprivacy`** privacy manifest to the app target (required by App Store review; its absence can also break some push/SDK behaviors).
|
|
533
|
+
- Match the **provider** to your token type: if you registered an **APNs** device/VoIP token, the dashboard provider must be **APNs** (`.p8` + Team ID + Key ID, dev-vs-prod environment matching the build); if you route iOS through **FCM**, register with the FCM provider and the `FCM_IOS` platform. A token registered against the wrong provider silently never delivers. See `cometchat-ios-push`.
|
|
534
|
+
|
|
523
535
|
---
|
|
524
536
|
|
|
525
537
|
### Memory Warnings / Crashes
|
|
@@ -530,9 +542,9 @@ pod 'CometChatCallsSDK', '~> 4.0'
|
|
|
530
542
|
|
|
531
543
|
1. **Use weak references in closures:**
|
|
532
544
|
```swift
|
|
533
|
-
conversations.onItemClick
|
|
545
|
+
conversations.set(onItemClick: { [weak self] conversation, _ in
|
|
534
546
|
self?.openMessages(for: conversation)
|
|
535
|
-
}
|
|
547
|
+
})
|
|
536
548
|
```
|
|
537
549
|
|
|
538
550
|
2. **Remove listeners when done:**
|
|
@@ -573,11 +585,19 @@ CometChatUIKit.login(uid: "user-123") { result in
|
|
|
573
585
|
|
|
574
586
|
## 3. Debugging Techniques
|
|
575
587
|
|
|
576
|
-
###
|
|
588
|
+
### Inspect SDK errors
|
|
589
|
+
|
|
590
|
+
The CometChat iOS SDK has **no public log-level API** (there is no
|
|
591
|
+
`CometChat.setLogLevel` / `AppSettingsBuilder` logging toggle). Diagnose by
|
|
592
|
+
reading the `CometChatException` handed to each call's `onError` closure:
|
|
577
593
|
|
|
578
594
|
```swift
|
|
579
|
-
|
|
580
|
-
CometChat
|
|
595
|
+
CometChat.init(appId: appID, appSettings: settings, onSuccess: { _ in
|
|
596
|
+
print("CometChat init OK")
|
|
597
|
+
}, onError: { error in
|
|
598
|
+
// CometChatException → code + message (init's onError is non-optional)
|
|
599
|
+
print("init failed:", error.errorCode, error.errorDescription)
|
|
600
|
+
})
|
|
581
601
|
```
|
|
582
602
|
|
|
583
603
|
### Check Connection Status
|
|
@@ -640,7 +660,7 @@ Use Charles Proxy or Proxyman to inspect CometChat API calls:
|
|
|
640
660
|
```swift
|
|
641
661
|
// Print current state
|
|
642
662
|
print("User: \(CometChatUIKit.getLoggedInUser()?.uid ?? "none")")
|
|
643
|
-
print("
|
|
663
|
+
print("Logged in: \(CometChatUIKit.getLoggedInUser() != nil)")
|
|
644
664
|
```
|
|
645
665
|
|
|
646
666
|
---
|
|
@@ -670,7 +690,7 @@ print("Initialized: \(CometChatManager.shared.isInitialized)")
|
|
|
670
690
|
1. **Limit initial fetch:**
|
|
671
691
|
```swift
|
|
672
692
|
let conversations = CometChatConversations()
|
|
673
|
-
conversations.set(conversationsRequestBuilder:
|
|
693
|
+
conversations.set(conversationsRequestBuilder: ConversationRequest.ConversationRequestBuilder()
|
|
674
694
|
.set(limit: 20) // Reduce initial load
|
|
675
695
|
)
|
|
676
696
|
```
|
|
@@ -740,9 +760,9 @@ struct ConversationsWrapper: UIViewControllerRepresentable {
|
|
|
740
760
|
|
|
741
761
|
func makeUIViewController(context: Context) -> CometChatConversations {
|
|
742
762
|
let vc = CometChatConversations()
|
|
743
|
-
vc.onItemClick
|
|
763
|
+
vc.set(onItemClick: { conversation, _ in
|
|
744
764
|
selectedConversation = conversation
|
|
745
|
-
}
|
|
765
|
+
})
|
|
746
766
|
return vc
|
|
747
767
|
}
|
|
748
768
|
|
|
@@ -790,7 +810,7 @@ When something isn't working:
|
|
|
790
810
|
7. [ ] **Check permissions:** Camera, microphone, notifications
|
|
791
811
|
8. [ ] **Check main thread:** UI updates on main thread
|
|
792
812
|
9. [ ] **Check completion handlers:** Wait for async operations
|
|
793
|
-
10. [ ] **
|
|
813
|
+
10. [ ] **Inspect errors:** read the `CometChatException` in each call's `onError` (`errorCode` + `errorDescription`) — the SDK has no log-level toggle
|
|
794
814
|
|
|
795
815
|
---
|
|
796
816
|
|
|
@@ -3,7 +3,6 @@ name: cometchat-native-bare-patterns
|
|
|
3
3
|
description: "Integration patterns for bare React Native CLI projects — pod install, Info.plist + AndroidManifest permissions, Apple privacy manifest, native module linking, Metro config."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Node.js >=18; React Native >=0.77; @cometchat/chat-uikit-react-native ^5"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list, ask-user"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
@@ -24,7 +23,7 @@ Teaches Claude how to integrate CometChat into a bare React Native CLI project.
|
|
|
24
23
|
|
|
25
24
|
**Read `cometchat-native-core` first** (init/login/wrapper chain + anti-patterns), then `cometchat-native-components`, then `cometchat-native-placement`.
|
|
26
25
|
|
|
27
|
-
Ground truth: `docs/ui-kit/react-native/react-native-cli-integration.mdx`, `apple-privacy-manifest-guide.mdx`, `react-native-conversation.mdx` + `react-native-one-to-one-chat.mdx` + `react-native-tab-based-chat.mdx`, and `examples/SampleApp/`.
|
|
26
|
+
Ground truth: `docs/ui-kit/react-native/react-native-cli-integration.mdx`, `apple-privacy-manifest-guide.mdx`, `react-native-conversation.mdx` + `react-native-one-to-one-chat.mdx` + `react-native-tab-based-chat.mdx`, and `examples/SampleApp/`. **Official docs:** https://www.cometchat.com/docs/ui-kit/react-native/overview · **Docs MCP:** `claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp` (or fetch the URL directly without MCP).
|
|
28
27
|
|
|
29
28
|
---
|
|
30
29
|
|
|
@@ -55,10 +54,11 @@ Ground truth: `docs/ui-kit/react-native/react-native-cli-integration.mdx`, `appl
|
|
|
55
54
|
|
|
56
55
|
```bash
|
|
57
56
|
# Core SDK + UI Kit
|
|
58
|
-
npm install @cometchat/chat-sdk-react-native
|
|
59
|
-
npm install @cometchat/chat-uikit-react-native
|
|
57
|
+
npm install @cometchat/chat-sdk-react-native@^4
|
|
58
|
+
npm install @cometchat/chat-uikit-react-native@^5
|
|
60
59
|
|
|
61
|
-
#
|
|
60
|
+
# Natively-linked deps used by the kit + sample apps. (datetimepicker isn't a
|
|
61
|
+
# declared kit peer, but every shipped sample installs it — keep it for parity.)
|
|
62
62
|
npm install \
|
|
63
63
|
@react-native-async-storage/async-storage \
|
|
64
64
|
@react-native-clipboard/clipboard \
|
|
@@ -75,6 +75,17 @@ npm install dayjs punycode
|
|
|
75
75
|
|
|
76
76
|
Bare RN uses autolinking, so no `react-native link` step is needed. Just confirm everything installed cleanly — if `npm install` errored mid-way, native modules won't be wired up correctly.
|
|
77
77
|
|
|
78
|
+
> ⚠️ **RN 0.85+ build trap — `react-native-document-picker` v9.x breaks the Android build (ENG-35701).** The unmaintained `react-native-document-picker@9.3.1` references `GuardedResultAsyncTask`, which React Native removed in 0.85.0. If the kit pulls it in transitively (or you add it for file uploads), `:react-native-document-picker:compileDebugJavaWithJavac` fails with `cannot find symbol class GuardedResultAsyncTask`. **Swap to `@react-native-documents/document-picker` (bare RN) or `expo-document-picker` (Expo):**
|
|
79
|
+
>
|
|
80
|
+
> ```bash
|
|
81
|
+
> # Bare RN (the maintained fork)
|
|
82
|
+
> npm uninstall react-native-document-picker
|
|
83
|
+
> npm install @react-native-documents/document-picker
|
|
84
|
+
> cd ios && pod install && cd ..
|
|
85
|
+
> ```
|
|
86
|
+
>
|
|
87
|
+
> Then in code, `import { pick } from '@react-native-documents/document-picker'` instead of the default export. The API surface is similar — `pick({ type: ['*/*'] })` returns a `Promise<DocumentPickerResult[]>`. See `cometchat-native-troubleshooting` §3bb for the full migration matrix.
|
|
88
|
+
|
|
78
89
|
### Optional — calling SDK
|
|
79
90
|
|
|
80
91
|
Only if the user's flow includes voice / video calls:
|
|
@@ -236,9 +247,9 @@ Open `android/app/src/main/AndroidManifest.xml` and add inside `<manifest>` (bef
|
|
|
236
247
|
|
|
237
248
|
**Merge, don't replace.** Keep the user's existing permissions for other libraries.
|
|
238
249
|
|
|
239
|
-
### 3b. Android: async-storage Maven repo (
|
|
250
|
+
### 3b. Android: async-storage Maven repo (ONLY if you use async-storage v3+)
|
|
240
251
|
|
|
241
|
-
`@react-native-async-storage/async-storage`
|
|
252
|
+
⚠️ **Conditional — not part of the default build.** The kit does NOT pin async-storage, and the shipped sample apps use `@react-native-async-storage/async-storage@^2.2.0` (which needs none of this). This step applies **only if you opt into async-storage v3+**, whose **local Maven artifact** autolinking can't find by default — then `./gradlew assembleDebug` fails with:
|
|
242
253
|
|
|
243
254
|
```
|
|
244
255
|
Could not find :react-native-async-storage_async-storage: on any of the paths.
|
|
@@ -259,7 +270,7 @@ allprojects {
|
|
|
259
270
|
}
|
|
260
271
|
```
|
|
261
272
|
|
|
262
|
-
Without this fix,
|
|
273
|
+
Without this fix, an async-storage-v3+ Android build fails early. (On the default async-storage v2.2.0 — what the samples ship — this isn't needed.)
|
|
263
274
|
|
|
264
275
|
> **Known issue (F78) — chat-sdk 4.0.22 breaks bare RN at runtime.** Separate from the build-time Maven error above: `@cometchat/chat-sdk-react-native@4.0.22` declares `react-native@0.64.2` + async-storage as **hard deps** (4.0.21 had none), so npm installs a nested duplicate react-native inside the SDK. The app builds fine but crashes at JS startup with `Cannot read property 'CometChatThemeProvider' of undefined` (AsyncStorage native module mismatch). **Expo is unaffected.** Fix: add npm `overrides` to dedupe, or pin `@cometchat/chat-sdk-react-native@4.0.21`. Full root cause + exact `overrides` block in `cometchat-native-troubleshooting` §3bc. Tracked in ENG-35653.
|
|
265
276
|
|
|
@@ -299,8 +310,8 @@ AppRegistry.registerComponent(appName, () => App);
|
|
|
299
310
|
// App.tsx
|
|
300
311
|
import React from "react";
|
|
301
312
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
302
|
-
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
303
|
-
import { CometChatThemeProvider } from "@cometchat/chat-uikit-react-native";
|
|
313
|
+
import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
|
|
314
|
+
import { CometChatThemeProvider, CometChatI18nProvider } from "@cometchat/chat-uikit-react-native";
|
|
304
315
|
import { CometChatProvider } from "./src/providers/CometChatProvider";
|
|
305
316
|
import { AppNavigator } from "./src/navigation/AppNavigator";
|
|
306
317
|
import Config from "react-native-config"; // or read from an env source
|
|
@@ -310,14 +321,18 @@ export default function App() {
|
|
|
310
321
|
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
311
322
|
<SafeAreaProvider>
|
|
312
323
|
<CometChatThemeProvider>
|
|
313
|
-
<
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
324
|
+
<CometChatI18nProvider>
|
|
325
|
+
<CometChatProvider
|
|
326
|
+
appId={Config.COMETCHAT_APP_ID!}
|
|
327
|
+
region={Config.COMETCHAT_REGION!}
|
|
328
|
+
authKey={Config.COMETCHAT_AUTH_KEY!}
|
|
329
|
+
uid="cometchat-uid-1" // dev mode only
|
|
330
|
+
>
|
|
331
|
+
<SafeAreaView edges={["top", "bottom"]} style={{ flex: 1 }}>
|
|
332
|
+
<AppNavigator />
|
|
333
|
+
</SafeAreaView>
|
|
334
|
+
</CometChatProvider>
|
|
335
|
+
</CometChatI18nProvider>
|
|
321
336
|
</CometChatThemeProvider>
|
|
322
337
|
</SafeAreaProvider>
|
|
323
338
|
</GestureHandlerRootView>
|
|
@@ -325,7 +340,7 @@ export default function App() {
|
|
|
325
340
|
}
|
|
326
341
|
```
|
|
327
342
|
|
|
328
|
-
The `CometChatProvider` itself lives in `src/providers/CometChatProvider.tsx` per `cometchat-native-core` § 6 — reuse that implementation.
|
|
343
|
+
The provider chain matches the kit sample app (`examples/SampleApp/App.tsx`): `CometChatI18nProvider` sits inside `CometChatThemeProvider`, and a root `SafeAreaView edges={["top", "bottom"]}` wraps the navigator. The `CometChatProvider` itself lives in `src/providers/CometChatProvider.tsx` per `cometchat-native-core` § 6 — reuse that implementation.
|
|
329
344
|
|
|
330
345
|
---
|
|
331
346
|
|
|
@@ -528,6 +543,8 @@ If the customer picks **Visually** in dispatcher Step 3.1, the bare RN recipe di
|
|
|
528
543
|
- Env via `react-native-dotenv` Babel plugin — the standard bare-RN convention. Add `[['module:react-native-dotenv']]` to `babel.config.js` plugins. Import via `import { COMETCHAT_APP_ID, COMETCHAT_REGION, COMETCHAT_AUTH_KEY } from "@env"`. Add a `src/env.d.ts` type declaration so TS recognizes the `@env` module.
|
|
529
544
|
- Required additional deps: `zustand`, `@react-native-async-storage/async-storage`, plus the standard 11 peers from §"Mandatory peer deps".
|
|
530
545
|
- `useConfig(s => s.settings.style)` — note the selector takes `AppConfig` directly, NOT `s.config.settings.style` (Finding F6, 2026-05-21).
|
|
546
|
+
- Envelope is `settings: { chatFeatures, callFeatures, layout, style, noCode }` — theme tokens live under `settings.style` (there's no `settings.theme`/`settings.agent`); the engagement feature group is `chatFeatures.deeperUserEngagement` (not `deeperEngagement`). See core §"Feature flag access".
|
|
547
|
+
- The reference builder app wires gesture-handler as a top-of-file side-effect import (`import './gesture-handler';`), not a `<GestureHandlerRootView>` wrapper; its provider chain is `SafeAreaProvider → SafeAreaView → CometChatThemeProvider → CometChatI18nProvider`. The general bare provider chain above (with `GestureHandlerRootView`) is also valid — see core §"Visual Builder integration" for the reference-matched template.
|
|
531
548
|
- iOS host: run `cd ios && pod install` after the deps land. B6 smoke validated: Metro bundles 4.6 MB iOS bundle clean on RN 0.81.5 + React 19.1.0.
|
|
532
549
|
|
|
533
550
|
If the customer picks **In code**, ignore this section — the standard four-wrapper chain + provider pattern applies.
|
|
@@ -3,7 +3,6 @@ name: cometchat-native-calls
|
|
|
3
3
|
description: CometChat Calls SDK integration for React Native (Expo managed + bare CLI). Covers @cometchat/calls-sdk-react-native install, dual-SDK init, native module linking (iOS pods, Android Gradle), VoIP push via react-native-callkeep + react-native-voip-push-notification + @react-native-firebase/messaging, CallKit on iOS / ConnectionService on Android, foreground service correctness on Android 14+, gesture handler + reanimated peer deps, Expo-specific config plugins, and additive-vs-standalone modes.
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "React Native >= 0.70 (>= 0.72 recommended), Expo SDK >= 49 (managed) / bare RN CLI; @cometchat/calls-sdk-react-native ^4.x; @cometchat/chat-sdk-react-native ^4.x; @cometchat/chat-uikit-react-native ^5.x (additive mode)"
|
|
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"
|
|
@@ -23,17 +22,19 @@ Production-grade voice + video calling for React Native (Expo managed + bare CLI
|
|
|
23
22
|
- Framework path: `cometchat-native-expo-patterns` (managed) OR `cometchat-native-bare-patterns` (CLI)
|
|
24
23
|
|
|
25
24
|
**Ground truth:**
|
|
26
|
-
- SDK source —
|
|
27
|
-
- Sample app —
|
|
25
|
+
- SDK source — `calls-sdk-react-native-5/package/`
|
|
26
|
+
- Sample app — `calls-sdk-react-native-5/sample-apps/cometchat-calls-sample-app-react-native/`
|
|
28
27
|
- Public docs — https://www.cometchat.com/docs/calls/react-native/overview
|
|
29
28
|
|
|
30
29
|
---
|
|
31
30
|
|
|
32
31
|
## 1. Hard rules — RN specialization
|
|
33
32
|
|
|
34
|
-
### 1.0 Calls SDK login
|
|
33
|
+
### 1.0 Calls SDK login — only the STANDALONE/raw-SDK path needs it
|
|
35
34
|
|
|
36
|
-
The
|
|
35
|
+
> ✅ **The additive UI-Kit path does NOT call `CometChatCalls.login`.** When calls are layered onto the RN UI Kit (the common case — `<CometChatIncomingCall>` at root + the auto call buttons in `CometChatMessageHeader`, calling extension enabled at `CometChatUIKit.init`), the kit chains the Calls-SDK auth off `CometChatUIKit.login` for you. **The canonical RN SampleApp wires calls end-to-end (incoming/outgoing/ongoing) with ZERO `CometChatCalls.login`** (verified across `examples/SampleApp` + `SampleAppWithPushNotifications`; the kit's `CometChatUIKit.login` only runs `CometChat.login`). Don't add it on the UI-Kit path — it's redundant.
|
|
36
|
+
|
|
37
|
+
**`await CometChatCalls.login(uid, AUTH_KEY)` is required ONLY on the STANDALONE / raw-Calls-SDK path** (§4a/§4b — no UI Kit; you call `CometChatCalls.generateToken` / render a custom call surface directly). There the Calls SDK has its own auth state: after `CometChat.login(uid, AUTH_KEY)` succeeds, also call `await CometChatCalls.login(uid, AUTH_KEY)` — without it the first raw calls API throws **"auth token cannot be null"**. (No imperative `joinSession` on RN — see rule below.)
|
|
37
38
|
|
|
38
39
|
```ts
|
|
39
40
|
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
@@ -141,6 +142,7 @@ Mount this wiring inside the root navigator OR in the App.tsx wrapper, ABOVE all
|
|
|
141
142
|
|
|
142
143
|
```tsx
|
|
143
144
|
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
145
|
+
import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
|
|
144
146
|
import {
|
|
145
147
|
CometChatIncomingCall,
|
|
146
148
|
CometChatOutgoingCall,
|
|
@@ -177,6 +179,13 @@ function CallSurfaces() {
|
|
|
177
179
|
},
|
|
178
180
|
ccShowOngoingCall: ({ call }) => setOngoingCall(call),
|
|
179
181
|
});
|
|
182
|
+
// Mid-call drops (peer left, network loss, server close) do NOT come through the
|
|
183
|
+
// Chat-SDK/UI-Kit channels above — they fire on the Calls SDK session events (v5).
|
|
184
|
+
// For a STANDALONE custom call surface, also register (clone skills/event-listeners):
|
|
185
|
+
// const offLeft = CometChatCalls.addEventListener('onSessionLeft', () => { /* reset state */ });
|
|
186
|
+
// const offClosed = CometChatCalls.addEventListener('onConnectionClosed', () => { /* reset state */ });
|
|
187
|
+
// // addEventListener returns an unsubscribe fn — call offLeft()/offClosed() on cleanup.
|
|
188
|
+
// (Additive mode using the kit's <CometChatOngoingCall> handles this internally.)
|
|
180
189
|
return () => {
|
|
181
190
|
CometChat.removeCallListener(CALL_LISTENER_ID);
|
|
182
191
|
CometChatUIEventHandler.removeCallListener(CALL_LISTENER_ID);
|
|
@@ -185,9 +194,10 @@ function CallSurfaces() {
|
|
|
185
194
|
|
|
186
195
|
return (
|
|
187
196
|
<>
|
|
188
|
-
{incomingCall && <View style={StyleSheet.absoluteFill}><CometChatIncomingCall call={incomingCall} /></View>}
|
|
197
|
+
{incomingCall && <View style={StyleSheet.absoluteFill}><CometChatIncomingCall call={incomingCall} onDecline={() => setIncomingCall(null)} /></View>}{/* onDecline is REQUIRED on the RN kit's CometChatIncomingCall (onAccept/onError optional) */}
|
|
189
198
|
{outgoingCall && <View style={StyleSheet.absoluteFill}><CometChatOutgoingCall call={outgoingCall} /></View>}
|
|
190
|
-
{
|
|
199
|
+
{/* CometChatOngoingCall has NO `call` prop — it takes sessionID (required) + callSettingsBuilder (required) + onError? (verified vs uikit-react-native-v5 CometChatOngoingCall.tsx). CometChatIncomingCall/OutgoingCall DO take `call`. */}
|
|
200
|
+
{ongoingCall && <View style={StyleSheet.absoluteFill}><CometChatOngoingCall sessionID={ongoingCall.getSessionId()} callSettingsBuilder={new CometChatCalls.CallSettingsBuilder().setIsAudioOnlyCall(ongoingCall.getType() === "audio")} /></View>}
|
|
191
201
|
</>
|
|
192
202
|
);
|
|
193
203
|
}
|
|
@@ -273,7 +283,7 @@ Without this guard, undefined env values produce opaque `TypeError: undefined is
|
|
|
273
283
|
### Bare RN CLI
|
|
274
284
|
|
|
275
285
|
```bash
|
|
276
|
-
npm install @cometchat/chat-sdk-react-native @cometchat/calls-sdk-react-native
|
|
286
|
+
npm install @cometchat/chat-sdk-react-native@^4 @cometchat/calls-sdk-react-native@^5
|
|
277
287
|
npm install react-native-callkeep react-native-voip-push-notification @react-native-firebase/app @react-native-firebase/messaging
|
|
278
288
|
npm install react-native-webrtc # Calls SDK peer dep
|
|
279
289
|
npm install react-native-gesture-handler react-native-reanimated # already installed if using UI Kit
|
|
@@ -408,12 +418,12 @@ export async function initCometChat() {
|
|
|
408
418
|
|
|
409
419
|
await CometChat.init(process.env.EXPO_PUBLIC_COMETCHAT_APP_ID!, appSettings);
|
|
410
420
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
.
|
|
415
|
-
|
|
416
|
-
|
|
421
|
+
// Calls SDK init takes a FLAT object — there is no CallAppSettingsBuilder in v5 RN.
|
|
422
|
+
await CometChatCalls.init({
|
|
423
|
+
appId: process.env.EXPO_PUBLIC_COMETCHAT_APP_ID!,
|
|
424
|
+
region: process.env.EXPO_PUBLIC_COMETCHAT_REGION!,
|
|
425
|
+
authKey: process.env.EXPO_PUBLIC_COMETCHAT_AUTH_KEY!,
|
|
426
|
+
});
|
|
417
427
|
|
|
418
428
|
initialized = true;
|
|
419
429
|
}
|
|
@@ -427,7 +437,7 @@ export async function initCometChat() {
|
|
|
427
437
|
|
|
428
438
|
### Calls SDK primitives
|
|
429
439
|
|
|
430
|
-
Same names + shapes as the JavaScript SDK (Section 3 of `cometchat-react-calls`).
|
|
440
|
+
Same names + shapes as the JavaScript SDK (Section 3 of `cometchat-react-calls`). RN-relevant session helpers include `switchCamera()`, `setAudioMode(mode)`, `muteAudio()`/`unmuteAudio()`, `pauseVideo()`/`resumeVideo()` — see the SDK's custom-ui reference. (Web-only helpers like device enumeration and virtual background are not available on RN.)
|
|
431
441
|
|
|
432
442
|
### UI Kit views (additive mode — `@cometchat/chat-uikit-react-native`)
|
|
433
443
|
|
|
@@ -476,7 +486,9 @@ When `product === "voice-video"` and there is no existing UI Kit.
|
|
|
476
486
|
|
|
477
487
|
### 4a. Standalone — Session mode (meeting-room UX, no ringing)
|
|
478
488
|
|
|
479
|
-
Calls SDK ONLY. NO Chat SDK. Matches
|
|
489
|
+
Calls SDK ONLY. NO Chat SDK. Matches `calls-sdk-react-native-5/sample-apps/cometchat-calls-sample-app-react-native/`.
|
|
490
|
+
|
|
491
|
+
> **⚠️ Idle timeout is in MILLISECONDS on React Native (the "instant exit on join" footgun).** Like the web SDK, the RN calls SDK's `SessionSettings` idle fields are **milliseconds, not seconds** (`calls-sdk-react-native/skills/session-settings`: `idleTimeoutPeriodBeforePrompt: 60000` ms). Setting `idleTimeoutPeriodBeforePrompt: 180` thinking "180s" means **180 ms** → the "Are you still there?" prompt fires and the session exits a fraction of a second after you join alone. Use ms: `{ idleTimeoutPeriodBeforePrompt: 180_000, idleTimeoutPeriodAfterPrompt: 60_000 }` (defaults 60_000 / 120_000). The timer only counts down when you're the **only** participant, so a solo test triggers it fastest. (Native Android/iOS/Flutter calls SDKs use **seconds** for `setIdleTimeoutPeriod`, default 300 — RN/web are the ms outliers.)
|
|
480
492
|
|
|
481
493
|
**MANDATORY install set (MUST run BEFORE scaffolding files — bundle will fail with `Unable to resolve module <name>` for each one missing):**
|
|
482
494
|
|
|
@@ -633,7 +645,7 @@ When `cometchat-native-core` integration already exists. The skill:
|
|
|
633
645
|
- [ ] CometChatUIKit.getLoggedInUser called with `.catch(() => null)` (rule 1.8.a)
|
|
634
646
|
- [ ] Error rendering uses `e.message` not `String(e)` (rule 1.8.b)
|
|
635
647
|
- [ ] Env-var guard: provider throws actionable error when appId/region undefined (rule 1.8.c "Also recommended")
|
|
636
|
-
- [ ] Hangup path includes `endSession` + `RNCallKeep.endCall`
|
|
648
|
+
- [ ] Hangup path includes `leaveSession()` (v5-canonical; `endSession` is a deprecated shim) + `RNCallKeep.endCall`
|
|
637
649
|
- [ ] Module-level `initialized` flag
|
|
638
650
|
|
|
639
651
|
**Runtime (real devices, both platforms):**
|
|
@@ -94,7 +94,7 @@ await CometChat.init(APP_ID, settings);
|
|
|
94
94
|
await CometChatCalls.init({ appId: APP_ID, region: REGION });
|
|
95
95
|
|
|
96
96
|
// Later, after CometChat.login:
|
|
97
|
-
await CometChatCalls.
|
|
97
|
+
await CometChatCalls.loginWithAuthToken(authToken);
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
---
|
|
@@ -185,7 +185,7 @@ Skipping any of these leaves zombies — call still showing in the OS as "active
|
|
|
185
185
|
- [ ] Info.plist + AndroidManifest permissions in place
|
|
186
186
|
- [ ] `foregroundServiceType` declared (Android 14+)
|
|
187
187
|
- [ ] Calls init AFTER chat init
|
|
188
|
-
- [ ] `CometChatCalls.
|
|
188
|
+
- [ ] `CometChatCalls.loginWithAuthToken(authToken)` after chat login
|
|
189
189
|
- [ ] CallKeep `setup` runs on app start (post-login)
|
|
190
190
|
- [ ] VoIP token registration triggered on iOS
|
|
191
191
|
- [ ] FCM token registration triggered on Android
|
|
@@ -12,23 +12,24 @@ Same SDK as web (TILE/SIDEBAR/SPOTLIGHT). RN-specific: layout switcher must be a
|
|
|
12
12
|
```ts
|
|
13
13
|
import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
// Layout values are the bare string literals "TILE" | "SIDEBAR" | "SPOTLIGHT".
|
|
16
|
+
// There are NO top-level LAYOUT / SESSION_TYPE named exports — the SDK only exports
|
|
17
|
+
// CometChatCalls. (Constants that exist are namespaced statics:
|
|
18
|
+
// CometChatCalls.CALL_MODE.* and CometChatCalls.AUDIO_MODE.* — verified against
|
|
19
|
+
// calls-sdk-react-native skills/session-settings.)
|
|
20
|
+
// Session type is the sessionSettings.sessionType field ('VIDEO' | 'VOICE'), not an enum import.
|
|
19
21
|
|
|
20
|
-
// Mid-call switch
|
|
21
|
-
CometChatCalls.setLayout(
|
|
22
|
+
// Mid-call switch — setLayout takes a bare string literal:
|
|
23
|
+
CometChatCalls.setLayout("SPOTLIGHT"); // "TILE" | "SIDEBAR" | "SPOTLIGHT"
|
|
22
24
|
|
|
23
25
|
// Listen
|
|
24
|
-
CometChatCalls.addEventListener("onCallLayoutChanged", (layout) => {
|
|
26
|
+
const off = CometChatCalls.addEventListener("onCallLayoutChanged", (layout) => {
|
|
25
27
|
// ...
|
|
26
28
|
});
|
|
29
|
+
// later: off(); // addEventListener returns the unsubscribe fn
|
|
27
30
|
|
|
28
|
-
// Hide kit
|
|
29
|
-
|
|
30
|
-
.setHideChangeLayoutButton(true)
|
|
31
|
-
.build();
|
|
31
|
+
// Hide the kit's change-layout button: it's a SessionSettings OBJECT field
|
|
32
|
+
// (hideChangeLayoutButton), passed to <CometChatCalls.Component />, not a builder method.
|
|
32
33
|
```
|
|
33
34
|
|
|
34
35
|
---
|
|
@@ -46,8 +47,8 @@ export function LayoutSwitcher() {
|
|
|
46
47
|
|
|
47
48
|
useEffect(() => {
|
|
48
49
|
const sub = (next: string) => setLayout(next as typeof LAYOUTS[number]);
|
|
49
|
-
CometChatCalls.addEventListener("onCallLayoutChanged", sub);
|
|
50
|
-
return () =>
|
|
50
|
+
const off = CometChatCalls.addEventListener("onCallLayoutChanged", sub);
|
|
51
|
+
return () => off();
|
|
51
52
|
}, []);
|
|
52
53
|
|
|
53
54
|
return (
|
|
@@ -109,7 +110,7 @@ Web sister rules apply, plus RN-specific:
|
|
|
109
110
|
|
|
110
111
|
## Verification checklist
|
|
111
112
|
|
|
112
|
-
- [ ]
|
|
113
|
+
- [ ] Layout switched via `CometChatCalls.setLayout("…")` (bare string literal)
|
|
113
114
|
- [ ] Switcher uses `Pressable` with `accessibilityRole="radio"`
|
|
114
115
|
- [ ] Layout listener cleaned up on unmount
|
|
115
116
|
- [ ] Orientation change handled (or explicitly stable)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Call session — joinSession with no ringing (React Native)
|
|
2
2
|
|
|
3
|
-
Server-generated sessionId, both parties enter it; RN uses a **declarative `<CometChatCalls.Component>` render primitive**, NOT the imperative `joinSession(token, settings, container)` web pattern. Customer-validated against
|
|
3
|
+
Server-generated sessionId, both parties enter it; RN uses a **declarative `<CometChatCalls.Component>` render primitive**, NOT the imperative `joinSession(token, settings, container)` web pattern. Customer-validated against `calls-sdk-react-native-5/sample-apps/cometchat-calls-sample-app-react-native/src/pages/join-session/JoinSession.tsx`.
|
|
4
4
|
|
|
5
5
|
**Read first:** `cometchat-react-calls/references/call-session.md` — full architecture (sessionId strategies, server-side authorization, token generation). Then come back here for the RN-specific render shape.
|
|
6
6
|
|
|
@@ -178,5 +178,5 @@ iOS `Info.plist`: `NSCameraUsageDescription`, `NSMicrophoneUsageDescription`. An
|
|
|
178
178
|
- `cometchat-react-calls/references/call-session.md` — cross-platform architecture (sessionId strategies, server authorization)
|
|
179
179
|
- `cometchat-native-calls/SKILL.md` — RN seven hard rules
|
|
180
180
|
- `cometchat-native-calls/references/share-invite.md` — deep-link config
|
|
181
|
-
- Upstream RN sample —
|
|
181
|
+
- Upstream RN sample — `calls-sdk-react-native-5/sample-apps/cometchat-calls-sample-app-react-native/src/pages/join-session/JoinSession.tsx`
|
|
182
182
|
- Canonical docs: https://www.cometchat.com/docs/calls/react-native/join-session
|
|
@@ -108,11 +108,15 @@ export function CustomOngoingCallScreen({ sessionId, authToken, isAudioOnly, onC
|
|
|
108
108
|
muted={muted}
|
|
109
109
|
cameraOff={cameraOff}
|
|
110
110
|
onToggleMute={() => {
|
|
111
|
-
|
|
111
|
+
// No-arg methods: muteAudio() / unmuteAudio() (no boolean param).
|
|
112
|
+
if (muted) CometChatCalls.unmuteAudio();
|
|
113
|
+
else CometChatCalls.muteAudio();
|
|
112
114
|
setMuted(!muted);
|
|
113
115
|
}}
|
|
114
116
|
onToggleCamera={() => {
|
|
115
|
-
|
|
117
|
+
// No-arg methods: pauseVideo() / resumeVideo() (no boolean param).
|
|
118
|
+
if (cameraOff) CometChatCalls.resumeVideo();
|
|
119
|
+
else CometChatCalls.pauseVideo();
|
|
116
120
|
setCameraOff(!cameraOff);
|
|
117
121
|
}}
|
|
118
122
|
onSwitchCamera={() => CometChatCalls.switchCamera()}
|
|
@@ -206,14 +210,14 @@ Without `InCallManager.stop()`, the app's other audio (music, video) routes thro
|
|
|
206
210
|
|
|
207
211
|
For multi-party calls where you want to highlight whoever's speaking:
|
|
208
212
|
|
|
213
|
+
The event is `onDominantSpeakerChanged` (there is no `onActiveSpeakerUpdated`). Use `addEventListener` (returns an unsubscribe fn) — `OngoingCallListener` is the @deprecated v4 path:
|
|
214
|
+
|
|
209
215
|
```ts
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
// Re-layout: move that uid's tile to a larger position
|
|
214
|
-
},
|
|
215
|
-
// ...
|
|
216
|
+
const off = CometChatCalls.addEventListener("onDominantSpeakerChanged", (uid: string) => {
|
|
217
|
+
setActiveSpeakerUid(uid);
|
|
218
|
+
// Re-layout: move that uid's tile to a larger position
|
|
216
219
|
});
|
|
220
|
+
// cleanup: off();
|
|
217
221
|
```
|
|
218
222
|
|
|
219
223
|
Not all SDK versions emit this event reliably; verify with the version you're on before relying on it.
|