@cometchat/skills 4.0.0 → 4.2.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/README.md +42 -2
- package/bin/install.js +448 -57
- package/package.json +1 -1
- package/skills/cometchat/SKILL.md +337 -80
- package/skills/cometchat-a11y/SKILL.md +476 -0
- package/skills/cometchat-android-v5/SKILL.md +1 -1
- package/skills/cometchat-android-v5-calls/SKILL.md +413 -0
- package/skills/cometchat-android-v5-calls/references/README.md +53 -0
- package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +195 -0
- package/skills/cometchat-android-v5-calls/references/audio-controls.md +91 -0
- package/skills/cometchat-android-v5-calls/references/background-handling.md +168 -0
- package/skills/cometchat-android-v5-calls/references/call-layouts.md +123 -0
- package/skills/cometchat-android-v5-calls/references/call-logs.md +113 -0
- package/skills/cometchat-android-v5-calls/references/call-session.md +274 -0
- package/skills/cometchat-android-v5-calls/references/custom-ui.md +150 -0
- package/skills/cometchat-android-v5-calls/references/event-listeners.md +123 -0
- package/skills/cometchat-android-v5-calls/references/group-calls.md +205 -0
- package/skills/cometchat-android-v5-calls/references/idle-timeout.md +111 -0
- package/skills/cometchat-android-v5-calls/references/in-call-chat.md +134 -0
- package/skills/cometchat-android-v5-calls/references/join-session.md +120 -0
- package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +206 -0
- package/skills/cometchat-android-v5-calls/references/participant-management.md +110 -0
- package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +106 -0
- package/skills/cometchat-android-v5-calls/references/raise-hand.md +242 -0
- package/skills/cometchat-android-v5-calls/references/recording.md +101 -0
- package/skills/cometchat-android-v5-calls/references/ringing-integration.md +152 -0
- package/skills/cometchat-android-v5-calls/references/screen-sharing.md +82 -0
- package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +215 -0
- package/skills/cometchat-android-v5-calls/references/session-settings.md +121 -0
- package/skills/cometchat-android-v5-calls/references/setup.md +137 -0
- package/skills/cometchat-android-v5-calls/references/share-invite.md +151 -0
- package/skills/cometchat-android-v5-calls/references/video-controls.md +87 -0
- package/skills/cometchat-android-v5-calls/references/voip-calling.md +526 -0
- package/skills/cometchat-android-v5-components/SKILL.md +1 -1
- package/skills/cometchat-android-v5-core/SKILL.md +1 -1
- package/skills/cometchat-android-v5-customization/SKILL.md +1 -1
- package/skills/cometchat-android-v5-extensions/SKILL.md +1 -1
- package/skills/cometchat-android-v5-features/SKILL.md +1 -1
- package/skills/cometchat-android-v5-placement/SKILL.md +1 -1
- package/skills/cometchat-android-v5-production/SKILL.md +1 -1
- package/skills/cometchat-android-v5-push/SKILL.md +1 -1
- package/skills/cometchat-android-v5-testing/SKILL.md +1 -1
- package/skills/cometchat-android-v5-theming/SKILL.md +1 -1
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-android-v6/SKILL.md +1 -1
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +1 -1
- package/skills/cometchat-android-v6-calls/SKILL.md +375 -0
- package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +97 -0
- package/skills/cometchat-android-v6-calls/references/call-layouts.md +91 -0
- package/skills/cometchat-android-v6-calls/references/call-session.md +163 -0
- package/skills/cometchat-android-v6-calls/references/device-management.md +171 -0
- package/skills/cometchat-android-v6-calls/references/group-calls.md +191 -0
- package/skills/cometchat-android-v6-calls/references/idle-timeout.md +107 -0
- package/skills/cometchat-android-v6-calls/references/in-call-chat.md +136 -0
- package/skills/cometchat-android-v6-calls/references/raise-hand.md +186 -0
- package/skills/cometchat-android-v6-calls/references/ringing-integration.md +176 -0
- package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +127 -0
- package/skills/cometchat-android-v6-calls/references/share-invite.md +105 -0
- package/skills/cometchat-android-v6-compose-components/SKILL.md +2 -2
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +1 -1
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +1 -1
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +1 -1
- package/skills/cometchat-android-v6-core/SKILL.md +1 -1
- package/skills/cometchat-android-v6-events/SKILL.md +1 -1
- package/skills/cometchat-android-v6-extensions/SKILL.md +1 -1
- package/skills/cometchat-android-v6-features/SKILL.md +1 -1
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +1 -1
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +1 -1
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +1 -1
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +1 -1
- package/skills/cometchat-android-v6-migration/SKILL.md +398 -0
- package/skills/cometchat-android-v6-production/SKILL.md +1 -1
- package/skills/cometchat-android-v6-push/SKILL.md +1 -1
- package/skills/cometchat-android-v6-testing/SKILL.md +1 -1
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-angular-calls/SKILL.md +511 -0
- package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +95 -0
- package/skills/cometchat-angular-calls/references/call-layouts.md +106 -0
- package/skills/cometchat-angular-calls/references/call-session.md +167 -0
- package/skills/cometchat-angular-calls/references/custom-ui.md +231 -0
- package/skills/cometchat-angular-calls/references/device-management.md +135 -0
- package/skills/cometchat-angular-calls/references/group-calls.md +412 -0
- package/skills/cometchat-angular-calls/references/idle-timeout.md +145 -0
- package/skills/cometchat-angular-calls/references/in-call-chat.md +148 -0
- package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +205 -0
- package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +53 -0
- package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +183 -0
- package/skills/cometchat-angular-calls/references/picture-in-picture.md +285 -0
- package/skills/cometchat-angular-calls/references/raise-hand.md +167 -0
- package/skills/cometchat-angular-calls/references/recording-screen-share.md +267 -0
- package/skills/cometchat-angular-calls/references/ringing-integration.md +131 -0
- package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +100 -0
- package/skills/cometchat-angular-calls/references/share-invite.md +116 -0
- package/skills/cometchat-angular-components/SKILL.md +1 -1
- package/skills/cometchat-angular-core/SKILL.md +1 -1
- package/skills/cometchat-angular-customization/SKILL.md +1 -1
- package/skills/cometchat-angular-features/SKILL.md +1 -1
- package/skills/cometchat-angular-patterns/SKILL.md +1 -1
- package/skills/cometchat-angular-placement/SKILL.md +1 -1
- package/skills/cometchat-angular-production/SKILL.md +1 -1
- package/skills/cometchat-angular-push/SKILL.md +403 -0
- package/skills/cometchat-angular-testing/SKILL.md +333 -0
- package/skills/cometchat-angular-theming/SKILL.md +1 -1
- package/skills/cometchat-angular-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-astro-patterns/SKILL.md +1 -1
- package/skills/cometchat-calls/SKILL.md +358 -0
- package/skills/cometchat-calls/references/use-case-broadcast.md +194 -0
- package/skills/cometchat-calls/references/use-case-marketplace.md +158 -0
- package/skills/cometchat-calls/references/use-case-support.md +190 -0
- package/skills/cometchat-calls/references/use-case-team.md +169 -0
- package/skills/cometchat-calls/references/use-case-telehealth.md +154 -0
- package/skills/cometchat-components/SKILL.md +1 -1
- package/skills/cometchat-core/SKILL.md +1 -1
- package/skills/cometchat-customization/SKILL.md +2 -2
- package/skills/cometchat-features/SKILL.md +2 -2
- package/skills/cometchat-flutter-v5/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-calls/SKILL.md +325 -94
- package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +169 -0
- package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +98 -0
- package/skills/cometchat-flutter-v5-calls/references/call-session.md +330 -0
- package/skills/cometchat-flutter-v5-calls/references/device-management.md +120 -0
- package/skills/cometchat-flutter-v5-calls/references/group-calls.md +187 -0
- package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +97 -0
- package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +132 -0
- package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +160 -0
- package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +244 -0
- package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +193 -0
- package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +101 -0
- package/skills/cometchat-flutter-v5-calls/references/share-invite.md +142 -0
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-core/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-customization/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-events/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-messages/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-production/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-push/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-testing/SKILL.md +390 -0
- package/skills/cometchat-flutter-v5-theming/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-calls/SKILL.md +308 -243
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +134 -0
- package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +102 -0
- package/skills/cometchat-flutter-v6-calls/references/call-session.md +229 -0
- package/skills/cometchat-flutter-v6-calls/references/device-management.md +99 -0
- package/skills/cometchat-flutter-v6-calls/references/group-calls.md +190 -0
- package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +80 -0
- package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +122 -0
- package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +268 -0
- package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +171 -0
- package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +93 -0
- package/skills/cometchat-flutter-v6-calls/references/share-invite.md +102 -0
- package/skills/cometchat-flutter-v6-components/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-core/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-customization/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-events/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-features/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-messages/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-migration/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-placement/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-production/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-push/SKILL.md +452 -0
- package/skills/cometchat-flutter-v6-testing/SKILL.md +319 -0
- package/skills/cometchat-flutter-v6-theming/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +1 -1
- package/skills/cometchat-i18n/SKILL.md +358 -0
- package/skills/cometchat-ios/SKILL.md +5 -5
- package/skills/cometchat-ios-calls/SKILL.md +409 -0
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +172 -0
- package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +189 -0
- package/skills/cometchat-ios-calls/references/call-layouts.md +136 -0
- package/skills/cometchat-ios-calls/references/call-session.md +221 -0
- package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +353 -0
- package/skills/cometchat-ios-calls/references/custom-ui.md +322 -0
- package/skills/cometchat-ios-calls/references/device-management.md +171 -0
- package/skills/cometchat-ios-calls/references/group-calls.md +396 -0
- package/skills/cometchat-ios-calls/references/idle-timeout.md +185 -0
- package/skills/cometchat-ios-calls/references/in-call-chat.md +183 -0
- package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +138 -0
- package/skills/cometchat-ios-calls/references/picture-in-picture.md +246 -0
- package/skills/cometchat-ios-calls/references/raise-hand.md +239 -0
- package/skills/cometchat-ios-calls/references/recording-screen-share.md +339 -0
- package/skills/cometchat-ios-calls/references/ringing-integration.md +142 -0
- package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +267 -0
- package/skills/cometchat-ios-calls/references/share-invite.md +152 -0
- package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +246 -0
- package/skills/cometchat-ios-calls/references/voip-cert-setup.md +166 -0
- package/skills/cometchat-ios-components/SKILL.md +1 -1
- package/skills/cometchat-ios-core/SKILL.md +1 -1
- package/skills/cometchat-ios-customization/SKILL.md +1 -1
- package/skills/cometchat-ios-features/SKILL.md +1 -1
- package/skills/cometchat-ios-placement/SKILL.md +1 -1
- package/skills/cometchat-ios-production/SKILL.md +1 -1
- package/skills/cometchat-ios-push/SKILL.md +1 -1
- package/skills/cometchat-ios-testing/SKILL.md +371 -0
- package/skills/cometchat-ios-theming/SKILL.md +1 -1
- package/skills/cometchat-ios-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-native-bare-patterns/SKILL.md +45 -3
- package/skills/cometchat-native-calls/SKILL.md +599 -0
- package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +203 -0
- package/skills/cometchat-native-calls/references/call-layouts.md +124 -0
- package/skills/cometchat-native-calls/references/call-session.md +182 -0
- package/skills/cometchat-native-calls/references/custom-ui.md +250 -0
- package/skills/cometchat-native-calls/references/device-management.md +135 -0
- package/skills/cometchat-native-calls/references/expo-vs-bare.md +179 -0
- package/skills/cometchat-native-calls/references/group-calls.md +291 -0
- package/skills/cometchat-native-calls/references/idle-timeout.md +128 -0
- package/skills/cometchat-native-calls/references/in-call-chat.md +143 -0
- package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +72 -0
- package/skills/cometchat-native-calls/references/picture-in-picture.md +276 -0
- package/skills/cometchat-native-calls/references/raise-hand.md +203 -0
- package/skills/cometchat-native-calls/references/recording-screen-share.md +290 -0
- package/skills/cometchat-native-calls/references/ringing-integration.md +118 -0
- package/skills/cometchat-native-calls/references/server-push-bridge.md +135 -0
- package/skills/cometchat-native-calls/references/server-push-payloads.md +193 -0
- package/skills/cometchat-native-calls/references/share-invite.md +144 -0
- package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +317 -0
- package/skills/cometchat-native-components/SKILL.md +1 -1
- package/skills/cometchat-native-core/SKILL.md +1 -1
- package/skills/cometchat-native-customization/SKILL.md +1 -1
- package/skills/cometchat-native-expo-patterns/SKILL.md +18 -1
- package/skills/cometchat-native-features/SKILL.md +1 -1
- package/skills/cometchat-native-placement/SKILL.md +1 -1
- package/skills/cometchat-native-production/SKILL.md +1 -1
- package/skills/cometchat-native-push/SKILL.md +1 -1
- package/skills/cometchat-native-testing/SKILL.md +1 -1
- package/skills/cometchat-native-theming/SKILL.md +1 -1
- package/skills/cometchat-native-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-nextjs-patterns/SKILL.md +1 -1
- package/skills/cometchat-placement/SKILL.md +29 -1
- package/skills/cometchat-production/SKILL.md +1 -1
- package/skills/cometchat-react-calls/SKILL.md +539 -0
- package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +145 -0
- package/skills/cometchat-react-calls/references/call-layouts.md +161 -0
- package/skills/cometchat-react-calls/references/call-session.md +235 -0
- package/skills/cometchat-react-calls/references/custom-ui.md +201 -0
- package/skills/cometchat-react-calls/references/device-management.md +206 -0
- package/skills/cometchat-react-calls/references/group-calls.md +262 -0
- package/skills/cometchat-react-calls/references/idle-timeout.md +175 -0
- package/skills/cometchat-react-calls/references/in-call-chat.md +212 -0
- package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +172 -0
- package/skills/cometchat-react-calls/references/picture-in-picture.md +245 -0
- package/skills/cometchat-react-calls/references/raise-hand.md +238 -0
- package/skills/cometchat-react-calls/references/recording-screen-share.md +143 -0
- package/skills/cometchat-react-calls/references/ringing-integration.md +255 -0
- package/skills/cometchat-react-calls/references/server-web-push-vapid.md +241 -0
- package/skills/cometchat-react-calls/references/share-invite.md +176 -0
- package/skills/cometchat-react-calls/references/testing-calls-on-web.md +198 -0
- package/skills/cometchat-react-calls/references/voip-and-web-push.md +165 -0
- package/skills/cometchat-react-patterns/SKILL.md +56 -8
- package/skills/cometchat-react-push/SKILL.md +448 -0
- package/skills/cometchat-react-router-patterns/SKILL.md +1 -1
- package/skills/cometchat-react-testing/SKILL.md +404 -0
- package/skills/cometchat-theming/SKILL.md +3 -3
- package/skills/cometchat-troubleshooting/SKILL.md +2 -2
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Group calls — broadcast meeting pattern (Android V5)
|
|
2
|
+
|
|
3
|
+
Group calls in CometChat use a **different signaling channel than 1:1 user calls**. The Ringing flow (`CometChat.initiateCall` → `onIncomingCallReceived` on peer) is **1:1 user only**. For groups, the kit broadcasts a **custom message of type `"meeting"`** to the group; receivers see a "Join meeting" card in `CometChatMessageList` (kit) or need an explicit `MessageListener.onCustomMessageReceived` (custom UI).
|
|
4
|
+
|
|
5
|
+
By-design kit behavior. Same semantic across all CometChat kits — confirmed against the React Native kit source 2026-05-15.
|
|
6
|
+
|
|
7
|
+
**Canonical docs:** https://www.cometchat.com/docs/calls/android/group-calls
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Architecture
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Caller (uidA, member of groupX) CometChat Receivers (members of groupX)
|
|
15
|
+
│ │ │
|
|
16
|
+
│ CometChatCallButtons sends a │ │
|
|
17
|
+
│ CustomMessage(GUID, GROUP, "meeting", │ │
|
|
18
|
+
│ { callType, sessionId }) │ │
|
|
19
|
+
├──────────────────────────────────────>│ │
|
|
20
|
+
│ │ onCustomMessageReceived │
|
|
21
|
+
│ ├─────────────────────────────>│
|
|
22
|
+
│ │ │
|
|
23
|
+
│ caller mounts CometChatOngoingCallActivity │
|
|
24
|
+
│ with sessionID = groupGuid │ receiver taps Join │
|
|
25
|
+
│ │ → joinSession(GUID) │
|
|
26
|
+
├──────────────────────────────────────>│ <─────────────────────────── │
|
|
27
|
+
│ ───── WebRTC session active (sessionId = group GUID) ─────│
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
| Channel | 1:1 user calls | Group calls |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| Signaling | `CometChat.initiateCall(call, callback)` | `CometChat.sendCustomMessage(message, callback)` (type="meeting") |
|
|
33
|
+
| Receiver event | `CallListener.onIncomingCallReceived` | `MessageListener.onCustomMessageReceived` |
|
|
34
|
+
| Session ID | server-generated unique | group's GUID (persistent) |
|
|
35
|
+
| Ring/decline | yes — `acceptCall` / `rejectCall` | no — receivers join or ignore |
|
|
36
|
+
| Auto-cancel timeout | yes (45s default) | no — meeting persists in chat history |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Hard rules
|
|
41
|
+
|
|
42
|
+
1. **Group calls broadcast a custom message; they do NOT use the call listener.** Custom UI with only `CometChat.addCallListener` receives NOTHING for group meetings.
|
|
43
|
+
2. **Session ID = group GUID.** Persistent, not auto-cancelled.
|
|
44
|
+
3. **Joining = `CometChatCalls.joinSession(sessionId, sessionSettings, container, CallbackListener)`** — single-call shape (token generation internal). `startSession` is a deprecated v4 shim; use `joinSession`.
|
|
45
|
+
4. **No `CometChat.endCall(sessionId)` for groups** — meeting messages have no call entity. Local `CallSession.getInstance().leaveSession()` only.
|
|
46
|
+
5. **ConnectionService / VoIP push for group meetings is NOT built-in.** The CometChat dashboard's push provider routes meeting messages as regular FCM notifications, not as `ACTION_CALL`. Customers wanting ConnectionService-ring for group meetings must intercept the FCM data payload, construct a `Connection` manually, and route into telecom.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Caller side — kit-based
|
|
51
|
+
|
|
52
|
+
```kotlin
|
|
53
|
+
// Inside a chat surface, e.g. inside CometChatMessageHeader:
|
|
54
|
+
val callButtons = CometChatCallButtons(this)
|
|
55
|
+
callButtons.setGroup(group)
|
|
56
|
+
// Tapping voice/video automatically:
|
|
57
|
+
// - sends CustomMessage(GUID, GROUP, "meeting", { callType, sessionId })
|
|
58
|
+
// - opens CometChatOngoingCallActivity with sessionID = group.guid
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
No additional code on the caller side. The kit signs the user up for the WebRTC session immediately.
|
|
62
|
+
|
|
63
|
+
## Caller side — custom UI
|
|
64
|
+
|
|
65
|
+
```kotlin
|
|
66
|
+
import com.cometchat.chat.core.CometChat
|
|
67
|
+
import com.cometchat.chat.models.CustomMessage
|
|
68
|
+
import com.cometchat.chat.constants.CometChatConstants
|
|
69
|
+
import org.json.JSONObject
|
|
70
|
+
|
|
71
|
+
fun startGroupCall(groupGuid: String, callType: String /* "audio" | "video" */) {
|
|
72
|
+
val sessionId = groupGuid
|
|
73
|
+
val customData = JSONObject().apply {
|
|
74
|
+
put("callType", callType)
|
|
75
|
+
put("sessionId", sessionId)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
val meetingMessage = CustomMessage(
|
|
79
|
+
groupGuid,
|
|
80
|
+
CometChatConstants.RECEIVER_TYPE_GROUP,
|
|
81
|
+
"meeting",
|
|
82
|
+
customData,
|
|
83
|
+
).apply {
|
|
84
|
+
category = CometChatConstants.CATEGORY_CUSTOM
|
|
85
|
+
metadata = JSONObject().apply {
|
|
86
|
+
put("incrementUnreadCount", true)
|
|
87
|
+
put("pushNotification", "meeting")
|
|
88
|
+
put("callType", callType)
|
|
89
|
+
put("sessionId", sessionId)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
CometChat.sendCustomMessage(meetingMessage, object : CometChat.CallbackListener<CustomMessage>() {
|
|
94
|
+
override fun onSuccess(p0: CustomMessage) {
|
|
95
|
+
// Caller navigates to OngoingCallActivity with sessionId
|
|
96
|
+
CometChatOngoingCallActivity.launch(this@CallerActivity, sessionId, callType)
|
|
97
|
+
}
|
|
98
|
+
override fun onError(p0: CometChatException) { /* surface error */ }
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Receiver side — kit-based (auto-renders meeting card)
|
|
106
|
+
|
|
107
|
+
If your group's chat surface uses `CometChatMessageList`, the kit renders the meeting `CustomMessage` as a "Join meeting" card. Tap → kit calls `getRTCToken` + opens `CometChatOngoingCallActivity` with `sessionID = group.guid`.
|
|
108
|
+
|
|
109
|
+
```kotlin
|
|
110
|
+
val messageList = CometChatMessageList(this)
|
|
111
|
+
messageList.setGroup(group)
|
|
112
|
+
// Meeting cards render automatically.
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Receiver side — custom UI (Kotlin Views / Compose — needs MessageListener)
|
|
116
|
+
|
|
117
|
+
```kotlin
|
|
118
|
+
private val GROUP_MEETING_LISTENER_ID = "APP_ROOT_GROUP_MEETING_LISTENER"
|
|
119
|
+
|
|
120
|
+
CometChat.addMessageListener(GROUP_MEETING_LISTENER_ID, object : CometChat.MessageListener() {
|
|
121
|
+
override fun onCustomMessageReceived(msg: CustomMessage) {
|
|
122
|
+
if (msg.category != CometChatConstants.CATEGORY_CUSTOM) return
|
|
123
|
+
if (msg.type != "meeting") return
|
|
124
|
+
|
|
125
|
+
val customData = msg.customData ?: return
|
|
126
|
+
val sessionId = customData.optString("sessionId", msg.receiverUid)
|
|
127
|
+
val callType = customData.optString("callType", "video")
|
|
128
|
+
val fromUid = msg.sender.uid
|
|
129
|
+
val groupGuid = msg.receiverUid
|
|
130
|
+
|
|
131
|
+
// Switch to main thread for UI work
|
|
132
|
+
runOnUiThread {
|
|
133
|
+
// Show your custom incoming-meeting UI:
|
|
134
|
+
// - notification with "Join" action
|
|
135
|
+
// - or in-app banner / full-screen activity
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
// Tear down in onDestroy:
|
|
141
|
+
override fun onDestroy() {
|
|
142
|
+
super.onDestroy()
|
|
143
|
+
CometChat.removeMessageListener(GROUP_MEETING_LISTENER_ID)
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Register in your `Application` class or main `Activity` AFTER login — same lifecycle constraint as the 1:1 `CallListener`.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Edge cases
|
|
152
|
+
|
|
153
|
+
### Late joining
|
|
154
|
+
|
|
155
|
+
Meeting messages persist in chat history. Tapping the card joins the live session — works even hours later, until everyone has left.
|
|
156
|
+
|
|
157
|
+
### Cancelling / leaving
|
|
158
|
+
|
|
159
|
+
Each participant leaves independently. No "cancel meeting" — the message stays in history.
|
|
160
|
+
|
|
161
|
+
```kotlin
|
|
162
|
+
CallSession.getInstance().leaveSession()
|
|
163
|
+
// NO CometChat.endCall — meetings have no call entity
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Push notifications
|
|
167
|
+
|
|
168
|
+
The meeting `CustomMessage` carries `metadata.pushNotification = "meeting"`. CometChat's push system delivers it as a regular FCM notification. To get ConnectionService-ringing for meetings, intercept the FCM data payload in `FirebaseMessagingService.onMessageReceived` and route to `TelecomManager` manually. Not auto-wired.
|
|
169
|
+
|
|
170
|
+
### Mixed cohorts
|
|
171
|
+
|
|
172
|
+
If one side uses the kit (auto-renders meeting card in `CometChatMessageList`) and the other uses custom Activity-based UI (no message listener), the custom side receives nothing. Both sides must align on listener strategy.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Anti-patterns
|
|
177
|
+
|
|
178
|
+
1. **Only `CometChat.addCallListener` registered, expecting group calls to ring.** Won't fire. Add a `MessageListener` too.
|
|
179
|
+
2. **`CometChat.endCall(sessionId)` after a group hangup.** No call entity exists — API errors. Use `CallSession.getInstance().leaveSession()` locally only.
|
|
180
|
+
3. **`<CometChatIncomingCall>` overlay activity expected for group meetings.** It only listens to 1:1 channel.
|
|
181
|
+
4. **Treating sessionId as ephemeral.** It IS the group's GUID. Persistent.
|
|
182
|
+
5. **Sending `CustomMessage` without `metadata.pushNotification = "meeting"`.** Offline group members won't get any push.
|
|
183
|
+
6. **Registering the `MessageListener` before login.** The SDK silently drops listeners registered pre-login. Wire AFTER login, as part of `CometChat.login`'s callback or `addCallListener` lifecycle.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Verification checklist
|
|
188
|
+
|
|
189
|
+
- [ ] If using kit caller: `CometChatCallButtons.setGroup(group)` + voice/video tap initiates the meeting message
|
|
190
|
+
- [ ] If using custom caller: `CometChat.sendCustomMessage` called with `type="meeting"`, `category=CATEGORY_CUSTOM`, `customData={callType, sessionId: groupGuid}`, `metadata.pushNotification="meeting"`
|
|
191
|
+
- [ ] If using kit receiver: `CometChatMessageList` renders the meeting card with a "Join" CTA
|
|
192
|
+
- [ ] If using custom receiver UI: `CometChat.addMessageListener` registered + filters `category==CATEGORY_CUSTOM && type=="meeting"`
|
|
193
|
+
- [ ] Listener registered AFTER login, NOT before
|
|
194
|
+
- [ ] On hangup: `CallSession.getInstance().leaveSession()` (NOT `CometChat.endCall`)
|
|
195
|
+
- [ ] Late-joining works
|
|
196
|
+
- [ ] FCM data payload routed to ConnectionService manually if OS-ring for meetings is desired
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Pointers
|
|
201
|
+
|
|
202
|
+
- `ringing-integration.md` — 1:1 user calls (different signaling channel)
|
|
203
|
+
- `cometchat-android-v5-calls/SKILL.md` rules — V5 hard rules (calls-sdk-android peer dep, etc.)
|
|
204
|
+
- Canonical docs: https://www.cometchat.com/docs/calls/android/group-calls
|
|
205
|
+
- Reference impl (cross-platform semantic): `cometchat-react-calls/references/group-calls.md`
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Idle timeout on Android V5
|
|
2
|
+
|
|
3
|
+
SDK API: SessionSettingsBuilder setters + listener event. ViewModel + StateFlow pattern (cf. `references/raise-hand.md`). Material AlertDialog or BottomSheet for the prompt.
|
|
4
|
+
|
|
5
|
+
**Canonical docs:** https://www.cometchat.com/docs/calls/android/idle-timeout
|
|
6
|
+
**Read first:** `cometchat-react-calls/references/idle-timeout.md` — settings + archetype timeouts.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## SDK API
|
|
11
|
+
|
|
12
|
+
```kotlin
|
|
13
|
+
import com.cometchat.calls.core.SessionSettingsBuilder
|
|
14
|
+
import com.cometchat.calls.core.SessionType
|
|
15
|
+
|
|
16
|
+
val settings = SessionSettingsBuilder(context, callContainer)
|
|
17
|
+
.setSessionType(SessionType.VIDEO)
|
|
18
|
+
.setIdleTimeoutPeriodBeforePrompt(60_000)
|
|
19
|
+
.setIdleTimeoutPeriodAfterPrompt(120_000)
|
|
20
|
+
.build()
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Listener — implement on `CometChatCallsEventsListener`:
|
|
24
|
+
|
|
25
|
+
```kotlin
|
|
26
|
+
override fun onSessionTimedOut() {
|
|
27
|
+
// Runs on background thread — dispatch to main
|
|
28
|
+
runOnUiThread {
|
|
29
|
+
Toast.makeText(this, "Call ended due to inactivity", Toast.LENGTH_LONG).show()
|
|
30
|
+
finish() // or NavController.popBackStack()
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## ViewModel pattern
|
|
38
|
+
|
|
39
|
+
```kotlin
|
|
40
|
+
data class CallUiState(val timedOut: Boolean = false)
|
|
41
|
+
|
|
42
|
+
class CallViewModel : ViewModel() {
|
|
43
|
+
private val _state = MutableStateFlow(CallUiState())
|
|
44
|
+
val state: StateFlow<CallUiState> = _state
|
|
45
|
+
|
|
46
|
+
fun onSessionTimedOut() {
|
|
47
|
+
_state.update { it.copy(timedOut = true) }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Activity collects:
|
|
52
|
+
lifecycleScope.launch {
|
|
53
|
+
repeatOnLifecycle(Lifecycle.State.STARTED) {
|
|
54
|
+
viewModel.state.collect { state ->
|
|
55
|
+
if (state.timedOut) {
|
|
56
|
+
showIdleTimeoutToast()
|
|
57
|
+
finish()
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The bridge is the listener calling `viewModel.onSessionTimedOut()` (cf. raise-hand.md ViewModel pattern).
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Prompt UI — Material AlertDialog
|
|
69
|
+
|
|
70
|
+
```kotlin
|
|
71
|
+
fun showIdlePrompt(onStay: () -> Unit, onEnd: () -> Unit) {
|
|
72
|
+
MaterialAlertDialogBuilder(this)
|
|
73
|
+
.setTitle("Still there?")
|
|
74
|
+
.setMessage("You're alone in this call. It'll end in 60 seconds.")
|
|
75
|
+
.setCancelable(false)
|
|
76
|
+
.setPositiveButton("Stay") { _, _ -> onStay() }
|
|
77
|
+
.setNegativeButton("End now") { _, _ -> onEnd() }
|
|
78
|
+
.show()
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`setCancelable(false)` prevents back-button dismiss; user must explicitly choose.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Anti-patterns
|
|
87
|
+
|
|
88
|
+
Web sister rules + Android-specific:
|
|
89
|
+
|
|
90
|
+
1. **`Toast.makeText` from background thread.** Crashes — must be on main. `runOnUiThread { ... }` or `lifecycleScope.launch { ... }`.
|
|
91
|
+
2. **Dialog without `setCancelable(false)`.** Back-button dismisses; the timer keeps running and disconnects without user response.
|
|
92
|
+
3. **Listener attached to a Fragment that's been replaced.** Idle timeout fires after fragment destroyed → IllegalStateException. Detach listener in `onDestroyView`.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Verification checklist
|
|
97
|
+
|
|
98
|
+
- [ ] SessionSettingsBuilder sets both idle periods
|
|
99
|
+
- [ ] `onSessionTimedOut` dispatches to main thread (`runOnUiThread` or coroutine)
|
|
100
|
+
- [ ] Dialog uses `setCancelable(false)`
|
|
101
|
+
- [ ] Listener attached in `onCreate`/`onResume`, detached in matching teardown
|
|
102
|
+
- [ ] Real-device smoke: 2 phones in call, hangup → other shows prompt after delay
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Pointers
|
|
107
|
+
|
|
108
|
+
- `cometchat-react-calls/references/idle-timeout.md` — sister reference
|
|
109
|
+
- `cometchat-android-v5-calls` SKILL.md
|
|
110
|
+
- `references/raise-hand.md` — ViewModel + StateFlow sibling pattern
|
|
111
|
+
- Canonical docs: https://www.cometchat.com/docs/calls/android/idle-timeout
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: in-call-chat
|
|
3
|
+
description: Add in-call messaging using CometChat Chat SDK and UI Kit. Use when implementing chat during calls, chat button, unread badge count, or group messaging linked to call session. Triggers on "in-call chat", "chat during call", "chat button", "in call messaging", "setChatButtonUnreadCount".
|
|
4
|
+
inclusion: manual
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CometChat Calls SDK v5 — In-Call Chat
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Add real-time text messaging during calls. Uses a CometChat Group (GUID = session ID) for chat. Requires Chat SDK + UI Kit alongside the Calls SDK.
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- Calls SDK + Chat SDK + UI Kit integrated
|
|
16
|
+
- Dependencies:
|
|
17
|
+
```kotlin
|
|
18
|
+
implementation("com.cometchat:chat-sdk-android:4.0.+")
|
|
19
|
+
implementation("com.cometchat:calls-sdk-android:5.0.0-beta.2")
|
|
20
|
+
implementation("com.cometchat:chat-uikit-android:4.+")
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Key Imports
|
|
24
|
+
|
|
25
|
+
```kotlin
|
|
26
|
+
import com.cometchat.calls.core.CallSession
|
|
27
|
+
import com.cometchat.calls.listeners.ButtonClickListener
|
|
28
|
+
import com.cometchat.chat.core.CometChat
|
|
29
|
+
import com.cometchat.chat.constants.CometChatConstants
|
|
30
|
+
import com.cometchat.chat.models.Group
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Implementation
|
|
34
|
+
|
|
35
|
+
### 1. Enable Chat Button
|
|
36
|
+
|
|
37
|
+
```kotlin
|
|
38
|
+
val sessionSettings = CometChatCalls.SessionSettingsBuilder()
|
|
39
|
+
.hideChatButton(false) // show chat button (hidden by default)
|
|
40
|
+
.build()
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 2. Create/Join Chat Group
|
|
44
|
+
|
|
45
|
+
Use session ID as group GUID:
|
|
46
|
+
|
|
47
|
+
```kotlin
|
|
48
|
+
private fun setupChatGroup(sessionId: String, meetingName: String) {
|
|
49
|
+
CometChat.getGroup(sessionId, object : CometChat.CallbackListener<Group>() {
|
|
50
|
+
override fun onSuccess(group: Group) {
|
|
51
|
+
if (!group.isJoined) {
|
|
52
|
+
CometChat.joinGroup(sessionId, group.groupType, null, /* listener */)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
override fun onError(e: CometChatException) {
|
|
56
|
+
if (e.code == "ERR_GUID_NOT_FOUND") {
|
|
57
|
+
val group = Group(sessionId, meetingName, CometChatConstants.GROUP_TYPE_PUBLIC, null)
|
|
58
|
+
CometChat.createGroup(group, /* listener */)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 3. Handle Chat Button Click
|
|
66
|
+
|
|
67
|
+
```kotlin
|
|
68
|
+
var unreadCount = 0
|
|
69
|
+
|
|
70
|
+
callSession.addButtonClickListener(this, object : ButtonClickListener() {
|
|
71
|
+
override fun onChatButtonClicked() {
|
|
72
|
+
unreadCount = 0
|
|
73
|
+
callSession.setChatButtonUnreadCount(0)
|
|
74
|
+
startActivity(Intent(this@CallActivity, ChatActivity::class.java).apply {
|
|
75
|
+
putExtra("SESSION_ID", sessionId)
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
// ... other overrides
|
|
79
|
+
})
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 4. Track Unread Messages
|
|
83
|
+
|
|
84
|
+
```kotlin
|
|
85
|
+
CometChat.addMessageListener(TAG, object : CometChat.MessageListener() {
|
|
86
|
+
override fun onTextMessageReceived(textMessage: TextMessage) {
|
|
87
|
+
val receiver = textMessage.receiver
|
|
88
|
+
if (receiver is Group && receiver.guid == sessionId) {
|
|
89
|
+
unreadCount++
|
|
90
|
+
CallSession.getInstance().setChatButtonUnreadCount(unreadCount)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
// Remove in onDestroy
|
|
96
|
+
override fun onDestroy() {
|
|
97
|
+
CometChat.removeMessageListener(TAG)
|
|
98
|
+
super.onDestroy()
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 5. Chat Activity (UI Kit)
|
|
103
|
+
|
|
104
|
+
```kotlin
|
|
105
|
+
class ChatActivity : AppCompatActivity() {
|
|
106
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
107
|
+
super.onCreate(savedInstanceState)
|
|
108
|
+
setContentView(R.layout.activity_chat)
|
|
109
|
+
val sessionId = intent.getStringExtra("SESSION_ID") ?: return
|
|
110
|
+
|
|
111
|
+
CometChat.getGroup(sessionId, object : CometChat.CallbackListener<Group>() {
|
|
112
|
+
override fun onSuccess(group: Group) {
|
|
113
|
+
findViewById<CometChatMessageList>(R.id.message_list).setGroup(group)
|
|
114
|
+
findViewById<CometChatMessageComposer>(R.id.message_composer).setGroup(group)
|
|
115
|
+
findViewById<CometChatMessageHeader>(R.id.message_header).setGroup(group)
|
|
116
|
+
}
|
|
117
|
+
override fun onError(e: CometChatException) {}
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Gotchas
|
|
124
|
+
|
|
125
|
+
- Chat button is **hidden by default** — use `.hideChatButton(false)` to show it
|
|
126
|
+
- The group GUID should match the session ID to link chat to the call
|
|
127
|
+
- `setChatButtonUnreadCount()` updates the badge on the built-in chat button
|
|
128
|
+
- Remove message listeners in `onDestroy()` to prevent leaks
|
|
129
|
+
- UI Kit components (`CometChatMessageList`, etc.) require the UI Kit dependency
|
|
130
|
+
- Create the group before or when joining the call — not after
|
|
131
|
+
|
|
132
|
+
## Sample App Reference
|
|
133
|
+
|
|
134
|
+
- `CallActivity.kt` — Session settings and button click listener setup
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: join-session
|
|
3
|
+
description: Join a CometChat call session using CometChatCalls.joinSession with SessionSettingsBuilder. Use when joining calls, configuring session settings, voice vs video calls, or generating tokens. Triggers on "join session", "join call", "start call", "SessionSettingsBuilder".
|
|
4
|
+
inclusion: manual
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CometChat Calls SDK v5 — Join Session
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Join a call session using `CometChatCalls.joinSession()`. Supports two approaches: direct session ID (simple) or manual token generation (advanced). Requires a `RelativeLayout` container and configured `SessionSettings`.
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- Calls SDK initialized and user logged in
|
|
16
|
+
- A valid session ID (from Chat SDK's `Call.sessionId` or your backend)
|
|
17
|
+
- A `RelativeLayout` container in your layout XML
|
|
18
|
+
|
|
19
|
+
## Key Imports
|
|
20
|
+
|
|
21
|
+
```kotlin
|
|
22
|
+
import com.cometchat.calls.core.CometChatCalls
|
|
23
|
+
import com.cometchat.calls.core.CallSession
|
|
24
|
+
import com.cometchat.calls.model.SessionType
|
|
25
|
+
import com.cometchat.calls.model.LayoutType
|
|
26
|
+
import com.cometchat.calls.model.AudioMode
|
|
27
|
+
import com.cometchat.calls.exceptions.CometChatException
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Implementation
|
|
31
|
+
|
|
32
|
+
### Layout Container
|
|
33
|
+
|
|
34
|
+
```xml
|
|
35
|
+
<RelativeLayout
|
|
36
|
+
android:id="@+id/call_view_container"
|
|
37
|
+
android:layout_width="match_parent"
|
|
38
|
+
android:layout_height="match_parent" />
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Join with Session ID (Recommended)
|
|
42
|
+
|
|
43
|
+
```kotlin
|
|
44
|
+
val callContainer = findViewById<RelativeLayout>(R.id.call_view_container)
|
|
45
|
+
|
|
46
|
+
val sessionSettings = CometChatCalls.SessionSettingsBuilder()
|
|
47
|
+
.setTitle("Team Meeting")
|
|
48
|
+
.setSessionType(if (isVoiceCall) SessionType.VOICE else SessionType.VIDEO)
|
|
49
|
+
.setLayout(LayoutType.TILE)
|
|
50
|
+
.setAudioMode(if (isVoiceCall) AudioMode.EARPIECE else AudioMode.SPEAKER)
|
|
51
|
+
.startAudioMuted(false)
|
|
52
|
+
.startVideoPaused(isVoiceCall)
|
|
53
|
+
.build()
|
|
54
|
+
|
|
55
|
+
CometChatCalls.joinSession(
|
|
56
|
+
sessionId,
|
|
57
|
+
sessionSettings,
|
|
58
|
+
callContainer,
|
|
59
|
+
object : CometChatCalls.CallbackListener<CallSession>() {
|
|
60
|
+
override fun onSuccess(callSession: CallSession) {
|
|
61
|
+
Log.d(TAG, "Joined session: $sessionId")
|
|
62
|
+
// Setup listeners on callSession
|
|
63
|
+
}
|
|
64
|
+
override fun onError(e: CometChatException) {
|
|
65
|
+
Log.e(TAG, "Failed to join: ${e.message}")
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Join with Token (Advanced)
|
|
72
|
+
|
|
73
|
+
```kotlin
|
|
74
|
+
// Step 1: Generate token
|
|
75
|
+
CometChatCalls.generateToken(sessionId, object : CometChatCalls.CallbackListener<GenerateToken>() {
|
|
76
|
+
override fun onSuccess(token: GenerateToken) {
|
|
77
|
+
// Step 2: Join with token
|
|
78
|
+
CometChatCalls.joinSession(token, sessionSettings, callContainer,
|
|
79
|
+
object : CometChatCalls.CallbackListener<CallSession>() {
|
|
80
|
+
override fun onSuccess(callSession: CallSession) { /* joined */ }
|
|
81
|
+
override fun onError(e: CometChatException) { /* error */ }
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
override fun onError(e: CometChatException) { /* token error */ }
|
|
86
|
+
})
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Voice Call vs Video Call
|
|
90
|
+
|
|
91
|
+
```kotlin
|
|
92
|
+
// Video call
|
|
93
|
+
val videoSettings = CometChatCalls.SessionSettingsBuilder()
|
|
94
|
+
.setSessionType(SessionType.VIDEO)
|
|
95
|
+
.setLayout(LayoutType.TILE)
|
|
96
|
+
.setAudioMode(AudioMode.SPEAKER)
|
|
97
|
+
.startVideoPaused(false)
|
|
98
|
+
.build()
|
|
99
|
+
|
|
100
|
+
// Voice call
|
|
101
|
+
val voiceSettings = CometChatCalls.SessionSettingsBuilder()
|
|
102
|
+
.setSessionType(SessionType.VOICE)
|
|
103
|
+
.setLayout(LayoutType.SPOTLIGHT)
|
|
104
|
+
.setAudioMode(AudioMode.EARPIECE)
|
|
105
|
+
.startVideoPaused(true)
|
|
106
|
+
.build()
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Gotchas
|
|
110
|
+
|
|
111
|
+
- The container **must** be a `RelativeLayout`, not `FrameLayout`
|
|
112
|
+
- All participants must use the **same session ID** to join the same call
|
|
113
|
+
- `SessionType` values are `VIDEO` and `VOICE` (not "AUDIO")
|
|
114
|
+
- Call `joinSession` only after SDK is initialized and user is logged in
|
|
115
|
+
- The `CallSession` returned in `onSuccess` is used to register all event listeners
|
|
116
|
+
|
|
117
|
+
## Sample App Reference
|
|
118
|
+
|
|
119
|
+
- `CallActivity.kt` — `joinSession()` method with voice/video branching
|
|
120
|
+
- `Repository.kt` — `loginCallsUser()` for authentication before joining
|