@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
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
# Device management on React Native
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**RN is NOT web.** The web `getVideoInputDevices()` / `getAudioInputDevices()` / `setVideoInputDevice()` enumeration getters **do not exist on the RN Calls SDK** — there is no `MediaDevices.enumerateDevices()` equivalent. On mobile there are only two cameras (front / rear) and a fixed set of audio routes (earpiece / speaker / Bluetooth / wired), so the RN SDK exposes:
|
|
4
|
+
|
|
5
|
+
- **Camera:** `CometChatCalls.switchCamera()` — toggles front ↔ rear (no device-id picker).
|
|
6
|
+
- **Audio output:** `CometChatCalls.setAudioMode(mode)` where `mode` is an `AUDIO_MODE` value (`"SPEAKER" | "EARPIECE" | "BLUETOOTH" | "HEADPHONES"`).
|
|
7
|
+
|
|
8
|
+
The thesis of this reference is therefore **`react-native-incall-manager`** for real-world routing UX.
|
|
4
9
|
|
|
5
10
|
**Canonical docs:** https://www.cometchat.com/docs/calls/react-native/device-management
|
|
6
|
-
**Read first:** `cometchat-react-calls/references/device-management.md` — pre-call picker pattern + empty-label gotcha + Bluetooth caveats.
|
|
11
|
+
**Read first:** `cometchat-react-calls/references/device-management.md` — pre-call picker pattern + empty-label gotcha + Bluetooth caveats (web-only enumeration semantics; do NOT carry the getters over to RN).
|
|
7
12
|
|
|
8
13
|
---
|
|
9
14
|
|
|
10
|
-
## SDK API
|
|
15
|
+
## SDK API (RN)
|
|
11
16
|
|
|
12
17
|
```ts
|
|
13
|
-
import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
|
|
18
|
+
import { CometChatCalls, AUDIO_MODE } from "@cometchat/calls-sdk-react-native";
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
// Front ↔ rear camera toggle (no enumeration / no device ids on RN):
|
|
21
|
+
CometChatCalls.switchCamera();
|
|
17
22
|
|
|
18
|
-
|
|
23
|
+
// Audio output route (mobile only):
|
|
24
|
+
CometChatCalls.setAudioMode(AUDIO_MODE.SPEAKER); // or EARPIECE / BLUETOOTH / HEADPHONES
|
|
19
25
|
```
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
There is no camera/mic device list to enumerate — `switchCamera()` flips between the two on-device cameras. For fine-grained audio routing (and reliable Bluetooth/headset detection) use `react-native-incall-manager` below.
|
|
22
28
|
|
|
23
29
|
---
|
|
24
30
|
|
|
@@ -68,39 +74,55 @@ InCallManager.startProximitySensor(); // optional — auto-screen-off when pho
|
|
|
68
74
|
|
|
69
75
|
---
|
|
70
76
|
|
|
71
|
-
## Camera
|
|
77
|
+
## Camera switch UI (front ↔ rear)
|
|
78
|
+
|
|
79
|
+
There's no device picker on RN — just a flip button calling `switchCamera()`:
|
|
72
80
|
|
|
73
81
|
```tsx
|
|
74
|
-
import { TouchableOpacity, Text
|
|
82
|
+
import { TouchableOpacity, Text } from "react-native";
|
|
83
|
+
import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
|
|
75
84
|
|
|
76
|
-
function
|
|
77
|
-
|
|
85
|
+
function FlipCameraButton() {
|
|
86
|
+
return (
|
|
87
|
+
<TouchableOpacity
|
|
88
|
+
onPress={() => CometChatCalls.switchCamera()} // toggles front ↔ rear; returns void
|
|
89
|
+
accessibilityRole="button"
|
|
90
|
+
accessibilityLabel="Switch camera"
|
|
91
|
+
>
|
|
92
|
+
<Text>Flip camera</Text>
|
|
93
|
+
</TouchableOpacity>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Audio output picker (SPEAKER / EARPIECE / BLUETOOTH / HEADPHONES)
|
|
78
99
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
100
|
+
```tsx
|
|
101
|
+
import { TouchableOpacity, Text, View } from "react-native";
|
|
102
|
+
import { CometChatCalls, AUDIO_MODE } from "@cometchat/calls-sdk-react-native";
|
|
103
|
+
|
|
104
|
+
const MODES = [AUDIO_MODE.SPEAKER, AUDIO_MODE.EARPIECE, AUDIO_MODE.BLUETOOTH, AUDIO_MODE.HEADPHONES];
|
|
82
105
|
|
|
106
|
+
function AudioOutputPicker() {
|
|
83
107
|
return (
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
keyExtractor={(d) => d.id}
|
|
87
|
-
renderItem={({ item }) => (
|
|
108
|
+
<View>
|
|
109
|
+
{MODES.map((mode) => (
|
|
88
110
|
<TouchableOpacity
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
onClose();
|
|
92
|
-
}}
|
|
111
|
+
key={mode}
|
|
112
|
+
onPress={() => CometChatCalls.setAudioMode(mode)}
|
|
93
113
|
accessibilityRole="button"
|
|
94
|
-
accessibilityLabel={`
|
|
114
|
+
accessibilityLabel={`Route audio to ${mode}`}
|
|
95
115
|
>
|
|
96
|
-
<Text>{
|
|
116
|
+
<Text>{mode}</Text>
|
|
97
117
|
</TouchableOpacity>
|
|
98
|
-
)}
|
|
99
|
-
|
|
118
|
+
))}
|
|
119
|
+
</View>
|
|
100
120
|
);
|
|
101
121
|
}
|
|
102
122
|
```
|
|
103
123
|
|
|
124
|
+
Note: `setAudioMode` is the SDK-level route hint; `react-native-incall-manager` (above) remains the most reliable cross-platform path for forcing speaker/Bluetooth and detecting headset plug/unplug.
|
|
125
|
+
|
|
104
126
|
---
|
|
105
127
|
|
|
106
128
|
## Anti-patterns
|
|
@@ -108,8 +130,8 @@ function CameraPicker({ onClose }: { onClose: () => void }) {
|
|
|
108
130
|
Web sister rules apply, plus RN-specific:
|
|
109
131
|
|
|
110
132
|
1. **Forgetting `InCallManager.stop()` on hangup.** Music + phone audio sound wrong until reboot.
|
|
111
|
-
2. **
|
|
112
|
-
3. **
|
|
133
|
+
2. **Spamming `switchCamera()` rapidly.** The SDK queues the front/rear toggle; double-tapping can drop the second toggle. Debounce the flip button.
|
|
134
|
+
3. **Assuming web-style device enumeration on RN.** There is no `getVideoInputDevices()`/`getAudioInputDevices()`/`setVideoInputDevice()` — use `switchCamera()` + `setAudioMode()`.
|
|
113
135
|
4. **Hardcoding speakerphone-on for voice calls.** User holding phone to ear wants earpiece. Default to earpiece for voice; speaker for video.
|
|
114
136
|
|
|
115
137
|
---
|
|
@@ -120,7 +142,8 @@ Web sister rules apply, plus RN-specific:
|
|
|
120
142
|
- [ ] `InCallManager.start({ media: "video"|"audio" })` on call start
|
|
121
143
|
- [ ] `InCallManager.stop()` on call end
|
|
122
144
|
- [ ] `setForceSpeakerphoneOn(true)` for video; `false` for voice
|
|
123
|
-
- [ ]
|
|
145
|
+
- [ ] Camera flip uses `CometChatCalls.switchCamera()` (no device enumeration on RN)
|
|
146
|
+
- [ ] Audio route changes use `CometChatCalls.setAudioMode(AUDIO_MODE.*)` and/or InCallManager
|
|
124
147
|
- [ ] Real-device smoke: AirPods connect mid-call → audio routes to AirPods
|
|
125
148
|
- [ ] Real-device smoke: speaker toggle on/off works
|
|
126
149
|
- [ ] Hangup smoke: music app's playback resumes correctly after call end
|
|
@@ -96,16 +96,19 @@ CometChat plan-driven. Common ceilings:
|
|
|
96
96
|
| Production | 25 |
|
|
97
97
|
| Enterprise | configurable up to 100 |
|
|
98
98
|
|
|
99
|
-
The SDK doesn't reject calls at capacity — it just stops admitting new joiners
|
|
99
|
+
The SDK doesn't reject calls at capacity — it just stops admitting new joiners. In v5, observe the roster via `addEventListener('onParticipantListChanged', ...)` (returns the full list, not a delta — clone `skills/event-listeners`) and surface the ceiling to the user:
|
|
100
100
|
|
|
101
101
|
```ts
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
const MAX_PARTICIPANTS = 25; // your plan's ceiling
|
|
103
|
+
const off = CometChatCalls.addEventListener(
|
|
104
|
+
"onParticipantListChanged",
|
|
105
|
+
(participants: Array<{ uid: string; name: string }>) => {
|
|
106
|
+
if (participants.length >= MAX_PARTICIPANTS) {
|
|
105
107
|
Alert.alert("Call is full", "This meeting has reached its participant limit.");
|
|
106
108
|
}
|
|
107
109
|
},
|
|
108
|
-
|
|
110
|
+
);
|
|
111
|
+
// cleanup: off();
|
|
109
112
|
```
|
|
110
113
|
|
|
111
114
|
---
|
|
@@ -113,12 +116,16 @@ const listener = new CometChatCalls.OngoingCallListener({
|
|
|
113
116
|
## Roster — who's in the call
|
|
114
117
|
|
|
115
118
|
```ts
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
// v5: addEventListener('onParticipantListChanged', ...) — the v4 OngoingCallListener.onUserListUpdated
|
|
120
|
+
// is deprecated (clone skills/event-listeners + skills/migration-v4-to-v5 mapping).
|
|
121
|
+
const off = CometChatCalls.addEventListener(
|
|
122
|
+
"onParticipantListChanged",
|
|
123
|
+
(users: Array<{ uid: string; name: string; avatar?: string }>) => {
|
|
118
124
|
// Re-render the participant strip
|
|
119
125
|
setParticipants(users);
|
|
120
126
|
},
|
|
121
|
-
|
|
127
|
+
);
|
|
128
|
+
// cleanup: off();
|
|
122
129
|
```
|
|
123
130
|
|
|
124
131
|
Fires whenever a participant joins or leaves. The roster includes the local user — filter them out of the "remote participants" UI:
|
|
@@ -132,14 +139,13 @@ const remoteParticipants = users.filter((u) => u.uid !== localUid);
|
|
|
132
139
|
|
|
133
140
|
## Active speaker detection
|
|
134
141
|
|
|
135
|
-
The SDK fires `
|
|
142
|
+
The SDK fires `onDominantSpeakerChanged` when the dominant audio source changes (there is no `onActiveSpeakerUpdated` event). Prefer `addEventListener` (returns an unsubscribe fn); `OngoingCallListener` is the @deprecated v4 path:
|
|
136
143
|
|
|
137
144
|
```ts
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
setActiveSpeakerUid(uid);
|
|
141
|
-
},
|
|
145
|
+
const off = CometChatCalls.addEventListener("onDominantSpeakerChanged", (uid: string) => {
|
|
146
|
+
setActiveSpeakerUid(uid);
|
|
142
147
|
});
|
|
148
|
+
// cleanup: off();
|
|
143
149
|
```
|
|
144
150
|
|
|
145
151
|
Use this to drive a "spotlight" layout — large tile for the active speaker, small thumbnails for the rest:
|
|
@@ -162,7 +168,7 @@ function SpotlightLayout({ participants, activeSpeakerUid }: Props) {
|
|
|
162
168
|
}
|
|
163
169
|
```
|
|
164
170
|
|
|
165
|
-
**Throttle re-layout** — `
|
|
171
|
+
**Throttle re-layout** — `onDominantSpeakerChanged` can fire multiple times per second in a noisy room. Debounce the layout swap to ~500ms minimum, otherwise tiles jitter.
|
|
166
172
|
|
|
167
173
|
---
|
|
168
174
|
|
|
@@ -173,28 +179,27 @@ These require the local user to be a group **owner** or **moderator** (CometChat
|
|
|
173
179
|
```ts
|
|
174
180
|
import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
|
|
175
181
|
|
|
176
|
-
// Mute a specific participant
|
|
177
|
-
|
|
178
|
-
|
|
182
|
+
// Mute a specific participant. The method is muteParticipant(participantId) — synchronous,
|
|
183
|
+
// returns void. There is NO muteUser()/removeUser() on the RN SDK.
|
|
184
|
+
function muteParticipant(participantId: string) {
|
|
185
|
+
CometChatCalls.muteParticipant(participantId);
|
|
179
186
|
}
|
|
180
187
|
|
|
181
188
|
// Mute everyone except local user
|
|
182
|
-
|
|
189
|
+
function muteAll() {
|
|
183
190
|
for (const p of participants) {
|
|
184
191
|
if (p.uid === localUid) continue;
|
|
185
|
-
|
|
192
|
+
CometChatCalls.muteParticipant(p.uid);
|
|
186
193
|
}
|
|
187
194
|
}
|
|
188
195
|
|
|
189
|
-
//
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
196
|
+
// NOTE: there is NO "kick / remove participant" API on the RN Calls SDK.
|
|
197
|
+
// Removal must be done via the Chat SDK group management (e.g. CometChat.kickGroupMember),
|
|
198
|
+
// which removes them from the group — not a per-call eject.
|
|
193
199
|
|
|
194
|
-
// Local user "raises hand" — signals to moderator
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
// The moderator's onUserRaisedHand listener fires
|
|
200
|
+
// Local user "raises hand" — signals to moderator (synchronous, returns void)
|
|
201
|
+
function raiseHand() {
|
|
202
|
+
CometChatCalls.raiseHand();
|
|
198
203
|
}
|
|
199
204
|
```
|
|
200
205
|
|
|
@@ -234,7 +239,7 @@ import * as Battery from "expo-battery";
|
|
|
234
239
|
|
|
235
240
|
const level = await Battery.getBatteryLevelAsync();
|
|
236
241
|
if (level < 0.2) {
|
|
237
|
-
|
|
242
|
+
CometChatCalls.pauseVideo(); // no-arg; resumeVideo() to resume (synchronous, returns void)
|
|
238
243
|
Alert.alert("Battery saver", "Video paused to save battery.");
|
|
239
244
|
}
|
|
240
245
|
```
|
|
@@ -261,8 +266,8 @@ Use this to render a "Join meeting" button on the group screen during an active
|
|
|
261
266
|
## Anti-patterns
|
|
262
267
|
|
|
263
268
|
1. **Rendering tiles for every participant.** At 25 people, you have 25 `<RTCView />` instances; that's where RN's bridge starts choking. Render the active speaker + max 6 thumbnails.
|
|
264
|
-
2. **Updating layout on every `
|
|
265
|
-
3. **Allowing non-moderators to call `
|
|
269
|
+
2. **Updating layout on every `onDominantSpeakerChanged`.** Debounce to 500ms minimum.
|
|
270
|
+
3. **Allowing non-moderators to call `muteParticipant`.** Only owners/moderators should see the button. (Per-call "kick" doesn't exist on the RN SDK — see above.)
|
|
266
271
|
4. **No bandwidth warning.** A user on cellular joining a 10-person call burns their data plan in minutes. Show a "Switch to audio-only" prompt at the threshold.
|
|
267
272
|
5. **Forgetting to filter local user from the roster.** "Speaking with myself" tile.
|
|
268
273
|
6. **Initiating group calls without group membership check.** Non-members get "ERR_NOT_GROUP_MEMBER" silently.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Idle timeout on React Native
|
|
2
2
|
|
|
3
|
-
Same SDK API as web — `
|
|
3
|
+
Same SDK API as web — `idleTimeoutPeriodBeforePrompt` + `idleTimeoutPeriodAfterPrompt` are SessionSettings **object fields** (ms), `onSessionTimedOut` event. RN-specific deltas are background-handling integration (call doesn't time out while the app is foregrounded; needs special handling in background) and the alert UI surface.
|
|
4
4
|
|
|
5
5
|
**Canonical docs:** https://www.cometchat.com/docs/calls/react-native/idle-timeout
|
|
6
6
|
**Read first:** `cometchat-react-calls/references/idle-timeout.md` — settings shape + recommended timeouts per archetype + custom prompt pattern.
|
|
@@ -12,11 +12,11 @@ Same SDK API as web — `setIdleTimeoutPeriodBeforePrompt` + `setIdleTimeoutPeri
|
|
|
12
12
|
```ts
|
|
13
13
|
import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
// SessionSettings OBJECT fields (ms) — NOT builder methods:
|
|
16
|
+
const settings = {
|
|
17
|
+
idleTimeoutPeriodBeforePrompt: 60_000,
|
|
18
|
+
idleTimeoutPeriodAfterPrompt: 120_000,
|
|
19
|
+
};
|
|
20
20
|
|
|
21
21
|
CometChatCalls.addEventListener("onSessionTimedOut", () => {
|
|
22
22
|
navigation.navigate("Home");
|
|
@@ -12,12 +12,14 @@ Same SDK API as web. RN-specific: BottomSheet panel UX (matches mobile patterns)
|
|
|
12
12
|
```ts
|
|
13
13
|
import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
// SessionSettings OBJECT field, not a builder method:
|
|
16
|
+
const settings = {
|
|
17
|
+
hideChatButton: false,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// addEventListener returns the unsubscribe fn — call it on cleanup.
|
|
21
|
+
const off = CometChatCalls.addEventListener("onChatButtonClicked", () => setOpen(true));
|
|
22
|
+
// later: off();
|
|
21
23
|
CometChatCalls.setChatButtonUnreadCount(5);
|
|
22
24
|
```
|
|
23
25
|
|
|
@@ -47,8 +49,8 @@ function InCallChatSheet({ sessionId }: Props) {
|
|
|
47
49
|
|
|
48
50
|
useEffect(() => {
|
|
49
51
|
const handler = () => sheetRef.current?.snapToIndex(1);
|
|
50
|
-
CometChatCalls.addEventListener("onChatButtonClicked", handler);
|
|
51
|
-
return () =>
|
|
52
|
+
const off = CometChatCalls.addEventListener("onChatButtonClicked", handler);
|
|
53
|
+
return () => off();
|
|
52
54
|
}, []);
|
|
53
55
|
|
|
54
56
|
useEffect(() => {
|
|
@@ -46,10 +46,10 @@ If any of these are stale, calls may fail silently with WebRTC negotiation error
|
|
|
46
46
|
## Migration steps (same as web)
|
|
47
47
|
|
|
48
48
|
1. Migrate init to plain object
|
|
49
|
-
2. Add `CometChatCalls.login(
|
|
49
|
+
2. Add `CometChatCalls.login(uid, authKey)` after `CometChat.login` (UID-based; the auth-token form is `CometChatCalls.loginWithAuthToken(authToken)` — verified against calls-sdk-react-native `skills/setup` + `skills/migration-v4-to-v5`)
|
|
50
50
|
3. Replace `CallSettingsBuilder` with plain `sessionSettings` object — **watch inverted booleans** (`show*` → `hide*`)
|
|
51
51
|
4. Replace `OngoingCallListener` with `addEventListener` calls
|
|
52
|
-
5. Rename methods: `endSession` → `leaveSession
|
|
52
|
+
5. Rename methods: `endSession` → `leaveSession`; `setMode('DEFAULT')` → the `sessionSettings.layout: 'SIDEBAR'` prop (DEFAULT maps to SIDEBAR). An imperative `CometChatCalls.setLayout('TILE' | 'SIDEBAR' | 'SPOTLIGHT')` does exist for runtime layout changes (calls-sdk-react-native `skills/custom-ui`). **RN has no imperative `joinSession`/`startSession`** — on RN the session is the declarative `<CometChatCalls.Component callToken={...} />` primitive (mint the token with `CometChatCalls.generateToken(sessionId)` and render the Component). There is no start/join method to call.
|
|
53
53
|
6. Cleanup: `addEventListener` returns an unsubscribe — call it on unmount
|
|
54
54
|
|
|
55
55
|
---
|
|
@@ -15,13 +15,14 @@ import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
|
|
|
15
15
|
CometChatCalls.raiseHand();
|
|
16
16
|
CometChatCalls.lowerHand();
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
CometChatCalls.addEventListener("
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
// addEventListener returns an unsubscribe function — capture it, call it in cleanup.
|
|
19
|
+
const off = CometChatCalls.addEventListener("onParticipantHandRaised", (p) => { ... });
|
|
20
|
+
// later: off();
|
|
21
|
+
|
|
22
|
+
// Button visibility is a SessionSettings OBJECT field, not a builder method:
|
|
23
|
+
const settings = {
|
|
24
|
+
hideRaiseHandButton: true,
|
|
25
|
+
};
|
|
25
26
|
```
|
|
26
27
|
|
|
27
28
|
---
|
|
@@ -102,11 +103,12 @@ function RaisedHandsSheet() {
|
|
|
102
103
|
});
|
|
103
104
|
};
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
CometChatCalls.addEventListener("
|
|
106
|
+
// addEventListener returns an unsubscribe fn; collect them and call on cleanup.
|
|
107
|
+
const offRaised = CometChatCalls.addEventListener("onParticipantHandRaised", onRaised);
|
|
108
|
+
const offLowered = CometChatCalls.addEventListener("onParticipantHandLowered", onLowered);
|
|
107
109
|
return () => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
offRaised();
|
|
111
|
+
offLowered();
|
|
110
112
|
};
|
|
111
113
|
}, [raised.size]);
|
|
112
114
|
|
|
@@ -149,8 +151,8 @@ useEffect(() => {
|
|
|
149
151
|
position: "top",
|
|
150
152
|
});
|
|
151
153
|
};
|
|
152
|
-
CometChatCalls.addEventListener("onParticipantHandRaised", onRaised);
|
|
153
|
-
return () =>
|
|
154
|
+
const off = CometChatCalls.addEventListener("onParticipantHandRaised", onRaised);
|
|
155
|
+
return () => off();
|
|
154
156
|
}, []);
|
|
155
157
|
```
|
|
156
158
|
|