@cometchat/skills 4.1.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/bin/install.js +298 -41
- package/package.json +1 -1
- package/skills/cometchat/SKILL.md +146 -27
- 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 +1 -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 +1 -1
- 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,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: audio-controls
|
|
3
|
+
description: Control audio during calls — mute/unmute microphone, switch audio output device (speaker, earpiece, bluetooth). Use when implementing audio toggle, audio mode switching, or custom mute buttons. Triggers on "mute audio", "unmute", "audio mode", "speaker", "earpiece", "bluetooth audio".
|
|
4
|
+
inclusion: manual
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CometChat Calls SDK v5 — Audio Controls
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Programmatically control the local microphone (mute/unmute) and audio output device (speaker, earpiece, Bluetooth, headphones) during an active call.
|
|
12
|
+
|
|
13
|
+
## Key Imports
|
|
14
|
+
|
|
15
|
+
```kotlin
|
|
16
|
+
import com.cometchat.calls.core.CallSession
|
|
17
|
+
import com.cometchat.calls.model.AudioMode
|
|
18
|
+
import com.cometchat.calls.listeners.MediaEventsListener
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Implementation
|
|
22
|
+
|
|
23
|
+
### Mute / Unmute
|
|
24
|
+
|
|
25
|
+
```kotlin
|
|
26
|
+
val callSession = CallSession.getInstance()
|
|
27
|
+
|
|
28
|
+
callSession.muteAudio() // mute microphone
|
|
29
|
+
callSession.unMuteAudio() // unmute microphone
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Switch Audio Output
|
|
33
|
+
|
|
34
|
+
```kotlin
|
|
35
|
+
callSession.setAudioMode(AudioMode.SPEAKER) // loudspeaker
|
|
36
|
+
callSession.setAudioMode(AudioMode.EARPIECE) // phone earpiece
|
|
37
|
+
callSession.setAudioMode(AudioMode.BLUETOOTH) // connected Bluetooth device
|
|
38
|
+
callSession.setAudioMode(AudioMode.HEADPHONES) // wired headphones
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Listen for Audio Events
|
|
42
|
+
|
|
43
|
+
```kotlin
|
|
44
|
+
callSession.addMediaEventsListener(this, object : MediaEventsListener() {
|
|
45
|
+
override fun onAudioMuted() {
|
|
46
|
+
// Update mute button to "muted" state
|
|
47
|
+
}
|
|
48
|
+
override fun onAudioUnMuted() {
|
|
49
|
+
// Update mute button to "unmuted" state
|
|
50
|
+
}
|
|
51
|
+
override fun onAudioModeChanged(audioMode: AudioMode) {
|
|
52
|
+
when (audioMode) {
|
|
53
|
+
AudioMode.SPEAKER -> { /* update icon */ }
|
|
54
|
+
AudioMode.EARPIECE -> { /* update icon */ }
|
|
55
|
+
AudioMode.BLUETOOTH -> { /* update icon */ }
|
|
56
|
+
AudioMode.HEADPHONES -> { /* update icon */ }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// ... other required overrides
|
|
60
|
+
override fun onVideoPaused() {}
|
|
61
|
+
override fun onVideoResumed() {}
|
|
62
|
+
override fun onRecordingStarted() {}
|
|
63
|
+
override fun onRecordingStopped() {}
|
|
64
|
+
override fun onScreenShareStarted() {}
|
|
65
|
+
override fun onScreenShareStopped() {}
|
|
66
|
+
override fun onCameraFacingChanged(facing: CameraFacing) {}
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Initial Audio Settings (Pre-Session)
|
|
71
|
+
|
|
72
|
+
```kotlin
|
|
73
|
+
val sessionSettings = CometChatCalls.SessionSettingsBuilder()
|
|
74
|
+
.startAudioMuted(true) // join muted
|
|
75
|
+
.setAudioMode(AudioMode.SPEAKER) // initial output device
|
|
76
|
+
.hideToggleAudioButton(false) // show mute button
|
|
77
|
+
.hideAudioModeButton(false) // show audio mode button
|
|
78
|
+
.build()
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Gotchas
|
|
82
|
+
|
|
83
|
+
- `muteAudio()` / `unMuteAudio()` only work during an active session
|
|
84
|
+
- Audio mode changes trigger `onAudioModeChanged()` on `MediaEventsListener`
|
|
85
|
+
- `AudioMode` enum: `SPEAKER`, `EARPIECE`, `BLUETOOTH`, `HEADPHONES`
|
|
86
|
+
- For voice calls, default to `AudioMode.EARPIECE`; for video calls, default to `AudioMode.SPEAKER`
|
|
87
|
+
- Bluetooth audio mode only works when a Bluetooth device is connected
|
|
88
|
+
|
|
89
|
+
## Sample App Reference
|
|
90
|
+
|
|
91
|
+
- `CallActivity.kt` — Sets `AudioMode.EARPIECE` for voice calls, `AudioMode.SPEAKER` for video calls
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: background-handling
|
|
3
|
+
description: Keep calls alive in background using CometChatOngoingCallService foreground service. Use when handling home button press during calls, ongoing call notifications, or preventing call termination. Triggers on "background handling", "foreground service", "ongoing call", "CometChatOngoingCallService", "keep call alive".
|
|
4
|
+
inclusion: manual
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CometChat Calls SDK v5 — Background Handling
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
`CometChatOngoingCallService` is a foreground service that keeps calls alive when users press HOME or switch apps. Shows an ongoing notification with tap-to-return and hangup actions.
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- Active call session
|
|
16
|
+
- Foreground service permissions in manifest
|
|
17
|
+
|
|
18
|
+
## Key Imports
|
|
19
|
+
|
|
20
|
+
```kotlin
|
|
21
|
+
import com.cometchat.calls.services.CometChatOngoingCallService
|
|
22
|
+
import com.cometchat.calls.utils.OngoingNotification
|
|
23
|
+
import com.cometchat.calls.core.CallSession
|
|
24
|
+
import com.cometchat.calls.listeners.SessionStatusListener
|
|
25
|
+
import com.cometchat.calls.listeners.ButtonClickListener
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Implementation
|
|
29
|
+
|
|
30
|
+
### 1. Manifest Permissions
|
|
31
|
+
|
|
32
|
+
```xml
|
|
33
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
34
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
|
|
35
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
|
|
36
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
|
|
37
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
|
|
38
|
+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. Start/Stop Service
|
|
42
|
+
|
|
43
|
+
```kotlin
|
|
44
|
+
callSession.addSessionStatusListener(this, object : SessionStatusListener() {
|
|
45
|
+
override fun onSessionJoined() {
|
|
46
|
+
CometChatOngoingCallService.launch(this@CallActivity)
|
|
47
|
+
}
|
|
48
|
+
override fun onSessionLeft() {
|
|
49
|
+
CometChatOngoingCallService.abort(this@CallActivity)
|
|
50
|
+
finish()
|
|
51
|
+
}
|
|
52
|
+
override fun onConnectionClosed() {
|
|
53
|
+
CometChatOngoingCallService.abort(this@CallActivity)
|
|
54
|
+
finish()
|
|
55
|
+
}
|
|
56
|
+
override fun onSessionTimedOut() {
|
|
57
|
+
CometChatOngoingCallService.abort(this@CallActivity)
|
|
58
|
+
finish()
|
|
59
|
+
}
|
|
60
|
+
override fun onConnectionLost() {}
|
|
61
|
+
override fun onConnectionRestored() {}
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 3. Handle Leave Button
|
|
66
|
+
|
|
67
|
+
```kotlin
|
|
68
|
+
callSession.addButtonClickListener(this, object : ButtonClickListener() {
|
|
69
|
+
override fun onLeaveSessionButtonClicked() {
|
|
70
|
+
endCall()
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 4. Handle Remote Call End
|
|
76
|
+
|
|
77
|
+
Register a `CometChat.CallListener` to detect when the remote party ends the call, then clean up the foreground service:
|
|
78
|
+
|
|
79
|
+
```kotlin
|
|
80
|
+
CometChat.addCallListener(LISTENER_ID, object : CometChat.CallListener() {
|
|
81
|
+
override fun onCallEndedMessageReceived(call: Call?) {
|
|
82
|
+
val session = CallSession.getInstance()
|
|
83
|
+
if (session.isSessionActive) {
|
|
84
|
+
session.leaveSession()
|
|
85
|
+
}
|
|
86
|
+
CometChatOngoingCallService.abort(this@CallActivity)
|
|
87
|
+
runOnUiThread { finish() }
|
|
88
|
+
}
|
|
89
|
+
override fun onIncomingCallReceived(call: Call?) {}
|
|
90
|
+
override fun onOutgoingCallAccepted(call: Call?) {}
|
|
91
|
+
override fun onOutgoingCallRejected(call: Call?) {}
|
|
92
|
+
override fun onIncomingCallCancelled(call: Call?) {}
|
|
93
|
+
})
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 5. Always Stop in onDestroy
|
|
97
|
+
|
|
98
|
+
```kotlin
|
|
99
|
+
override fun onDestroy() {
|
|
100
|
+
super.onDestroy()
|
|
101
|
+
CometChat.removeCallListener(LISTENER_ID)
|
|
102
|
+
CometChatOngoingCallService.abort(this)
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 6. Custom Notification (Optional)
|
|
107
|
+
|
|
108
|
+
```kotlin
|
|
109
|
+
private fun buildCustomNotification(): Notification {
|
|
110
|
+
val channelId = "CometChat_Call_Ongoing_Conference" // must use this ID
|
|
111
|
+
val intent = Intent(this, CallActivity::class.java).apply {
|
|
112
|
+
flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP
|
|
113
|
+
}
|
|
114
|
+
val pendingIntent = PendingIntent.getActivity(
|
|
115
|
+
this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
|
116
|
+
)
|
|
117
|
+
return NotificationCompat.Builder(this, channelId)
|
|
118
|
+
.setSmallIcon(R.drawable.ic_call)
|
|
119
|
+
.setContentTitle("Ongoing Call")
|
|
120
|
+
.setContentText("Tap to return to your call")
|
|
121
|
+
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
|
122
|
+
.setContentIntent(pendingIntent)
|
|
123
|
+
.setOngoing(true)
|
|
124
|
+
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
|
|
125
|
+
.build()
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Set before launching service
|
|
129
|
+
OngoingNotification.buildOngoingConferenceNotification(buildCustomNotification())
|
|
130
|
+
CometChatOngoingCallService.launch(this)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 7. VoIP Integration — Additional Cleanup (Optional)
|
|
134
|
+
|
|
135
|
+
When using background handling with VoIP calling (ConnectionService + TelecomManager), also disconnect the `CallConnection` and cancel any VoIP notifications on every terminal state:
|
|
136
|
+
|
|
137
|
+
```kotlin
|
|
138
|
+
// In each terminal callback (onSessionLeft, onSessionTimedOut, onConnectionClosed, onCallEndedMessageReceived):
|
|
139
|
+
CometChatOngoingCallService.abort(this@CallActivity)
|
|
140
|
+
CallConnectionHolder.endCall()
|
|
141
|
+
CallNotificationManager.cancelNotification(this@CallActivity)
|
|
142
|
+
finish()
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
See the `sample-app-voip` CallActivity for the full VoIP-integrated pattern.
|
|
146
|
+
|
|
147
|
+
## API Reference
|
|
148
|
+
|
|
149
|
+
| Method | Description |
|
|
150
|
+
|--------|-------------|
|
|
151
|
+
| `CometChatOngoingCallService.launch(context)` | Start foreground service |
|
|
152
|
+
| `CometChatOngoingCallService.abort(context)` | Stop foreground service |
|
|
153
|
+
| `OngoingNotification.buildOngoingConferenceNotification(notification)` | Set custom notification (call before `launch()`) |
|
|
154
|
+
|
|
155
|
+
## Gotchas
|
|
156
|
+
|
|
157
|
+
- The notification channel ID **must** be `"CometChat_Call_Ongoing_Conference"`
|
|
158
|
+
- Always call `abort()` in `onDestroy()` to prevent leaked services
|
|
159
|
+
- Always remove `CometChat.CallListener` in `onDestroy()` to prevent leaks
|
|
160
|
+
- This is for keeping **active** calls alive — for receiving calls when app is killed, use VoIP Calling
|
|
161
|
+
- Call `launch()` only after `onSessionJoined()` — not before joining
|
|
162
|
+
- Custom notification must be set **before** calling `launch()`
|
|
163
|
+
- When using VoIP (ConnectionService), also call `CallConnectionHolder.endCall()` in every terminal state to properly disconnect the Telecom connection
|
|
164
|
+
|
|
165
|
+
## Sample App Reference
|
|
166
|
+
|
|
167
|
+
- `sample-app-ringing` — `CallActivity.kt` — basic foreground service pattern with `launch()` in `onSessionJoined()`, `abort()` in `onSessionLeft()` and `onDestroy()`
|
|
168
|
+
- `sample-app-voip` — `CallActivity.kt` — full VoIP-integrated pattern with foreground service + CallConnection cleanup + notification cancellation on every terminal state
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Call layouts on Android V5 (Views)
|
|
2
|
+
|
|
3
|
+
Same three layouts (TILE/SIDEBAR/SPOTLIGHT). Android V5 uses Java/Kotlin builders + `MaterialButtonToggleGroup` for the switcher (Material Components for Android).
|
|
4
|
+
|
|
5
|
+
**Canonical docs:** https://www.cometchat.com/docs/calls/android/call-layouts
|
|
6
|
+
**Read first:** `cometchat-react-calls/references/call-layouts.md` — layout matrix + when to lock.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## SDK API
|
|
11
|
+
|
|
12
|
+
```kotlin
|
|
13
|
+
import com.cometchat.calls.constants.CometChatCallsConstants
|
|
14
|
+
import com.cometchat.calls.core.CallSettingsBuilder
|
|
15
|
+
import com.cometchat.calls.core.CometChatCalls
|
|
16
|
+
|
|
17
|
+
val settings = CallSettingsBuilder(activity)
|
|
18
|
+
.setSessionType(CometChatCallsConstants.SESSION_TYPE_VIDEO)
|
|
19
|
+
.setLayout(CometChatCallsConstants.LAYOUT_TILE) // _TILE | _SIDEBAR | _SPOTLIGHT
|
|
20
|
+
.setHideChangeLayoutButton(false)
|
|
21
|
+
.build()
|
|
22
|
+
|
|
23
|
+
// Mid-call switch
|
|
24
|
+
CometChatCalls.setLayout(CometChatCallsConstants.LAYOUT_SPOTLIGHT)
|
|
25
|
+
|
|
26
|
+
// Listen
|
|
27
|
+
val callsEventListener = object : CometChatCallsEventsListener {
|
|
28
|
+
override fun onCallLayoutChanged(layout: String) {
|
|
29
|
+
activity.runOnUiThread {
|
|
30
|
+
// Update segmented button state
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## XML — MaterialButtonToggleGroup
|
|
39
|
+
|
|
40
|
+
```xml
|
|
41
|
+
<com.google.android.material.button.MaterialButtonToggleGroup
|
|
42
|
+
android:id="@+id/layoutToggle"
|
|
43
|
+
android:layout_width="wrap_content"
|
|
44
|
+
android:layout_height="wrap_content"
|
|
45
|
+
app:singleSelection="true"
|
|
46
|
+
app:selectionRequired="true"
|
|
47
|
+
android:contentDescription="@string/call_layout">
|
|
48
|
+
|
|
49
|
+
<com.google.android.material.button.MaterialButton
|
|
50
|
+
android:id="@+id/layoutTile"
|
|
51
|
+
style="@style/Widget.Material3.Button.OutlinedButton"
|
|
52
|
+
android:text="@string/layout_tile" />
|
|
53
|
+
|
|
54
|
+
<com.google.android.material.button.MaterialButton
|
|
55
|
+
android:id="@+id/layoutSidebar"
|
|
56
|
+
style="@style/Widget.Material3.Button.OutlinedButton"
|
|
57
|
+
android:text="@string/layout_sidebar" />
|
|
58
|
+
|
|
59
|
+
<com.google.android.material.button.MaterialButton
|
|
60
|
+
android:id="@+id/layoutSpotlight"
|
|
61
|
+
style="@style/Widget.Material3.Button.OutlinedButton"
|
|
62
|
+
android:text="@string/layout_spotlight" />
|
|
63
|
+
</com.google.android.material.button.MaterialButtonToggleGroup>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Wire-up in Activity
|
|
69
|
+
|
|
70
|
+
```kotlin
|
|
71
|
+
binding.layoutToggle.addOnButtonCheckedListener { _, checkedId, isChecked ->
|
|
72
|
+
if (!isChecked) return@addOnButtonCheckedListener
|
|
73
|
+
|
|
74
|
+
val layout = when (checkedId) {
|
|
75
|
+
R.id.layoutTile -> CometChatCallsConstants.LAYOUT_TILE
|
|
76
|
+
R.id.layoutSidebar -> CometChatCallsConstants.LAYOUT_SIDEBAR
|
|
77
|
+
R.id.layoutSpotlight -> CometChatCallsConstants.LAYOUT_SPOTLIGHT
|
|
78
|
+
else -> return@addOnButtonCheckedListener
|
|
79
|
+
}
|
|
80
|
+
CometChatCalls.setLayout(layout)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Sync from kit's switcher
|
|
84
|
+
override fun onCallLayoutChanged(layout: String) {
|
|
85
|
+
runOnUiThread {
|
|
86
|
+
val id = when (layout) {
|
|
87
|
+
CometChatCallsConstants.LAYOUT_TILE -> R.id.layoutTile
|
|
88
|
+
CometChatCallsConstants.LAYOUT_SIDEBAR -> R.id.layoutSidebar
|
|
89
|
+
CometChatCallsConstants.LAYOUT_SPOTLIGHT -> R.id.layoutSpotlight
|
|
90
|
+
else -> return@runOnUiThread
|
|
91
|
+
}
|
|
92
|
+
binding.layoutToggle.check(id)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Anti-patterns
|
|
100
|
+
|
|
101
|
+
Web sister rules apply, plus Android-specific:
|
|
102
|
+
|
|
103
|
+
1. **`Spinner` instead of `MaterialButtonToggleGroup`.** Spinner hides options; toggle group is the radio-group native pattern in Material.
|
|
104
|
+
2. **`onCheckedChange` without `isChecked` guard.** Fires twice (once for unchecked, once for checked) — spurious `setLayout` calls.
|
|
105
|
+
3. **Forgetting `runOnUiThread` in the listener.** Crash on view updates from background thread.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Verification checklist
|
|
110
|
+
|
|
111
|
+
- [ ] Initial layout via `setLayout` on builder
|
|
112
|
+
- [ ] `MaterialButtonToggleGroup` with `singleSelection="true"`
|
|
113
|
+
- [ ] `addOnButtonCheckedListener` guards on `isChecked`
|
|
114
|
+
- [ ] `onCallLayoutChanged` updates toggle group on UI thread
|
|
115
|
+
- [ ] Real-device smoke: switcher cycles all 3, kit's switcher syncs custom UI
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Pointers
|
|
120
|
+
|
|
121
|
+
- `cometchat-react-calls/references/call-layouts.md` — sister
|
|
122
|
+
- `cometchat-android-v5-calls` SKILL.md
|
|
123
|
+
- Canonical docs: https://www.cometchat.com/docs/calls/android/call-layouts
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: call-logs
|
|
3
|
+
description: Fetch call history using CallLogRequest with pagination and filters. Use when displaying call logs, filtering by type/status/recording, or accessing recordings. Triggers on "call logs", "call history", "CallLogRequest", "fetch recordings".
|
|
4
|
+
inclusion: manual
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CometChat Calls SDK v5 — Call Logs
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Retrieve call history using `CallLogRequest` with pagination, filtering by type, status, direction, recordings, and specific users/groups.
|
|
12
|
+
|
|
13
|
+
## Key Imports
|
|
14
|
+
|
|
15
|
+
```kotlin
|
|
16
|
+
import com.cometchat.calls.core.CometChatCalls
|
|
17
|
+
import com.cometchat.calls.model.CallLog
|
|
18
|
+
import com.cometchat.calls.model.CallLogRequest
|
|
19
|
+
import com.cometchat.calls.model.Recording
|
|
20
|
+
import com.cometchat.calls.exceptions.CometChatException
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Implementation
|
|
24
|
+
|
|
25
|
+
### Basic Fetch
|
|
26
|
+
|
|
27
|
+
```kotlin
|
|
28
|
+
val callLogRequest = CallLogRequest.CallLogRequestBuilder()
|
|
29
|
+
.setLimit(30)
|
|
30
|
+
.build()
|
|
31
|
+
|
|
32
|
+
callLogRequest.fetchNext(object : CometChatCalls.CallbackListener<List<CallLog>>() {
|
|
33
|
+
override fun onSuccess(callLogs: List<CallLog>) {
|
|
34
|
+
for (log in callLogs) {
|
|
35
|
+
Log.d(TAG, "Session: ${log.sessionID}, Duration: ${log.totalDuration}, Status: ${log.status}")
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
override fun onError(e: CometChatException) {
|
|
39
|
+
Log.e(TAG, "Error: ${e.message}")
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Filtered Queries
|
|
45
|
+
|
|
46
|
+
```kotlin
|
|
47
|
+
// Video calls only
|
|
48
|
+
CallLogRequest.CallLogRequestBuilder().setSessionType("video").setLimit(20).build()
|
|
49
|
+
|
|
50
|
+
// Calls with recordings
|
|
51
|
+
CallLogRequest.CallLogRequestBuilder().setHasRecording(true).build()
|
|
52
|
+
|
|
53
|
+
// Missed incoming calls
|
|
54
|
+
CallLogRequest.CallLogRequestBuilder().setCallStatus("missed").setCallDirection("incoming").build()
|
|
55
|
+
|
|
56
|
+
// Calls with a specific user
|
|
57
|
+
CallLogRequest.CallLogRequestBuilder().setUid("user_id").build()
|
|
58
|
+
|
|
59
|
+
// Meeting calls only
|
|
60
|
+
CallLogRequest.CallLogRequestBuilder().setCallCategory("meet").build()
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Pagination
|
|
64
|
+
|
|
65
|
+
```kotlin
|
|
66
|
+
// Forward pagination
|
|
67
|
+
callLogRequest.fetchNext(listener)
|
|
68
|
+
|
|
69
|
+
// Backward pagination
|
|
70
|
+
callLogRequest.fetchPrevious(listener)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Access Recordings
|
|
74
|
+
|
|
75
|
+
```kotlin
|
|
76
|
+
for (callLog in callLogs) {
|
|
77
|
+
if (callLog.isHasRecording) {
|
|
78
|
+
callLog.recordings?.forEach { recording ->
|
|
79
|
+
Log.d(TAG, "URL: ${recording.recordingURL}")
|
|
80
|
+
Log.d(TAG, "Duration: ${recording.duration} seconds")
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### CallLog Properties
|
|
87
|
+
|
|
88
|
+
| Property | Type | Description |
|
|
89
|
+
|----------|------|-------------|
|
|
90
|
+
| `sessionID` | String | Session identifier |
|
|
91
|
+
| `type` | String | `video` or `audio` |
|
|
92
|
+
| `status` | String | `ended`, `missed`, `rejected`, `cancelled`, etc. |
|
|
93
|
+
| `callCategory` | String | `call` or `meet` |
|
|
94
|
+
| `totalDuration` | String | Human-readable duration |
|
|
95
|
+
| `totalParticipants` | int | Participant count |
|
|
96
|
+
| `hasRecording` | boolean | Whether recorded |
|
|
97
|
+
| `recordings` | List\<Recording\> | Recording objects |
|
|
98
|
+
| `initiator` | CallEntity | Who started the call |
|
|
99
|
+
| `receiver` | CallEntity | Who received the call |
|
|
100
|
+
|
|
101
|
+
## Gotchas
|
|
102
|
+
|
|
103
|
+
- `CallLogRequest` is from the **Calls SDK**, not the Chat SDK
|
|
104
|
+
- `setSessionType()` takes lowercase strings: `"video"` or `"audio"`
|
|
105
|
+
- `setCallDirection()` takes `"incoming"` or `"outgoing"`
|
|
106
|
+
- `setCallCategory()` takes `"call"` or `"meet"`
|
|
107
|
+
- Create a new `CallLogRequest` to reset pagination
|
|
108
|
+
- The sample app uses Chat SDK's `MessagesRequest` for call logs — the Calls SDK's `CallLogRequest` provides richer data
|
|
109
|
+
|
|
110
|
+
## Sample App Reference
|
|
111
|
+
|
|
112
|
+
- `Repository.kt` — `fetchCallLogs()` (uses Chat SDK approach)
|
|
113
|
+
- For Calls SDK approach, use `CallLogRequest` as shown above
|