@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.
Files changed (258) hide show
  1. package/README.md +42 -2
  2. package/bin/install.js +448 -57
  3. package/package.json +1 -1
  4. package/skills/cometchat/SKILL.md +337 -80
  5. package/skills/cometchat-a11y/SKILL.md +476 -0
  6. package/skills/cometchat-android-v5/SKILL.md +1 -1
  7. package/skills/cometchat-android-v5-calls/SKILL.md +413 -0
  8. package/skills/cometchat-android-v5-calls/references/README.md +53 -0
  9. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +195 -0
  10. package/skills/cometchat-android-v5-calls/references/audio-controls.md +91 -0
  11. package/skills/cometchat-android-v5-calls/references/background-handling.md +168 -0
  12. package/skills/cometchat-android-v5-calls/references/call-layouts.md +123 -0
  13. package/skills/cometchat-android-v5-calls/references/call-logs.md +113 -0
  14. package/skills/cometchat-android-v5-calls/references/call-session.md +274 -0
  15. package/skills/cometchat-android-v5-calls/references/custom-ui.md +150 -0
  16. package/skills/cometchat-android-v5-calls/references/event-listeners.md +123 -0
  17. package/skills/cometchat-android-v5-calls/references/group-calls.md +205 -0
  18. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +111 -0
  19. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +134 -0
  20. package/skills/cometchat-android-v5-calls/references/join-session.md +120 -0
  21. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +206 -0
  22. package/skills/cometchat-android-v5-calls/references/participant-management.md +110 -0
  23. package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +106 -0
  24. package/skills/cometchat-android-v5-calls/references/raise-hand.md +242 -0
  25. package/skills/cometchat-android-v5-calls/references/recording.md +101 -0
  26. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +152 -0
  27. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +82 -0
  28. package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +215 -0
  29. package/skills/cometchat-android-v5-calls/references/session-settings.md +121 -0
  30. package/skills/cometchat-android-v5-calls/references/setup.md +137 -0
  31. package/skills/cometchat-android-v5-calls/references/share-invite.md +151 -0
  32. package/skills/cometchat-android-v5-calls/references/video-controls.md +87 -0
  33. package/skills/cometchat-android-v5-calls/references/voip-calling.md +526 -0
  34. package/skills/cometchat-android-v5-components/SKILL.md +1 -1
  35. package/skills/cometchat-android-v5-core/SKILL.md +1 -1
  36. package/skills/cometchat-android-v5-customization/SKILL.md +1 -1
  37. package/skills/cometchat-android-v5-extensions/SKILL.md +1 -1
  38. package/skills/cometchat-android-v5-features/SKILL.md +1 -1
  39. package/skills/cometchat-android-v5-placement/SKILL.md +1 -1
  40. package/skills/cometchat-android-v5-production/SKILL.md +1 -1
  41. package/skills/cometchat-android-v5-push/SKILL.md +1 -1
  42. package/skills/cometchat-android-v5-testing/SKILL.md +1 -1
  43. package/skills/cometchat-android-v5-theming/SKILL.md +1 -1
  44. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +1 -1
  45. package/skills/cometchat-android-v6/SKILL.md +1 -1
  46. package/skills/cometchat-android-v6-builder-settings/SKILL.md +1 -1
  47. package/skills/cometchat-android-v6-calls/SKILL.md +375 -0
  48. package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +97 -0
  49. package/skills/cometchat-android-v6-calls/references/call-layouts.md +91 -0
  50. package/skills/cometchat-android-v6-calls/references/call-session.md +163 -0
  51. package/skills/cometchat-android-v6-calls/references/device-management.md +171 -0
  52. package/skills/cometchat-android-v6-calls/references/group-calls.md +191 -0
  53. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +107 -0
  54. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +136 -0
  55. package/skills/cometchat-android-v6-calls/references/raise-hand.md +186 -0
  56. package/skills/cometchat-android-v6-calls/references/ringing-integration.md +176 -0
  57. package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +127 -0
  58. package/skills/cometchat-android-v6-calls/references/share-invite.md +105 -0
  59. package/skills/cometchat-android-v6-compose-components/SKILL.md +2 -2
  60. package/skills/cometchat-android-v6-compose-customization/SKILL.md +1 -1
  61. package/skills/cometchat-android-v6-compose-placement/SKILL.md +1 -1
  62. package/skills/cometchat-android-v6-compose-theming/SKILL.md +1 -1
  63. package/skills/cometchat-android-v6-core/SKILL.md +1 -1
  64. package/skills/cometchat-android-v6-events/SKILL.md +1 -1
  65. package/skills/cometchat-android-v6-extensions/SKILL.md +1 -1
  66. package/skills/cometchat-android-v6-features/SKILL.md +1 -1
  67. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +1 -1
  68. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +1 -1
  69. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +1 -1
  70. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +1 -1
  71. package/skills/cometchat-android-v6-migration/SKILL.md +398 -0
  72. package/skills/cometchat-android-v6-production/SKILL.md +1 -1
  73. package/skills/cometchat-android-v6-push/SKILL.md +1 -1
  74. package/skills/cometchat-android-v6-testing/SKILL.md +1 -1
  75. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +1 -1
  76. package/skills/cometchat-angular-calls/SKILL.md +511 -0
  77. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +95 -0
  78. package/skills/cometchat-angular-calls/references/call-layouts.md +106 -0
  79. package/skills/cometchat-angular-calls/references/call-session.md +167 -0
  80. package/skills/cometchat-angular-calls/references/custom-ui.md +231 -0
  81. package/skills/cometchat-angular-calls/references/device-management.md +135 -0
  82. package/skills/cometchat-angular-calls/references/group-calls.md +412 -0
  83. package/skills/cometchat-angular-calls/references/idle-timeout.md +145 -0
  84. package/skills/cometchat-angular-calls/references/in-call-chat.md +148 -0
  85. package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +205 -0
  86. package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +53 -0
  87. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +183 -0
  88. package/skills/cometchat-angular-calls/references/picture-in-picture.md +285 -0
  89. package/skills/cometchat-angular-calls/references/raise-hand.md +167 -0
  90. package/skills/cometchat-angular-calls/references/recording-screen-share.md +267 -0
  91. package/skills/cometchat-angular-calls/references/ringing-integration.md +131 -0
  92. package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +100 -0
  93. package/skills/cometchat-angular-calls/references/share-invite.md +116 -0
  94. package/skills/cometchat-angular-components/SKILL.md +1 -1
  95. package/skills/cometchat-angular-core/SKILL.md +1 -1
  96. package/skills/cometchat-angular-customization/SKILL.md +1 -1
  97. package/skills/cometchat-angular-features/SKILL.md +1 -1
  98. package/skills/cometchat-angular-patterns/SKILL.md +1 -1
  99. package/skills/cometchat-angular-placement/SKILL.md +1 -1
  100. package/skills/cometchat-angular-production/SKILL.md +1 -1
  101. package/skills/cometchat-angular-push/SKILL.md +403 -0
  102. package/skills/cometchat-angular-testing/SKILL.md +333 -0
  103. package/skills/cometchat-angular-theming/SKILL.md +1 -1
  104. package/skills/cometchat-angular-troubleshooting/SKILL.md +1 -1
  105. package/skills/cometchat-astro-patterns/SKILL.md +1 -1
  106. package/skills/cometchat-calls/SKILL.md +358 -0
  107. package/skills/cometchat-calls/references/use-case-broadcast.md +194 -0
  108. package/skills/cometchat-calls/references/use-case-marketplace.md +158 -0
  109. package/skills/cometchat-calls/references/use-case-support.md +190 -0
  110. package/skills/cometchat-calls/references/use-case-team.md +169 -0
  111. package/skills/cometchat-calls/references/use-case-telehealth.md +154 -0
  112. package/skills/cometchat-components/SKILL.md +1 -1
  113. package/skills/cometchat-core/SKILL.md +1 -1
  114. package/skills/cometchat-customization/SKILL.md +2 -2
  115. package/skills/cometchat-features/SKILL.md +2 -2
  116. package/skills/cometchat-flutter-v5/SKILL.md +1 -1
  117. package/skills/cometchat-flutter-v5-calls/SKILL.md +325 -94
  118. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +169 -0
  119. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +98 -0
  120. package/skills/cometchat-flutter-v5-calls/references/call-session.md +330 -0
  121. package/skills/cometchat-flutter-v5-calls/references/device-management.md +120 -0
  122. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +187 -0
  123. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +97 -0
  124. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +132 -0
  125. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +160 -0
  126. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +244 -0
  127. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +193 -0
  128. package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +101 -0
  129. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +142 -0
  130. package/skills/cometchat-flutter-v5-conversations/SKILL.md +1 -1
  131. package/skills/cometchat-flutter-v5-core/SKILL.md +1 -1
  132. package/skills/cometchat-flutter-v5-customization/SKILL.md +1 -1
  133. package/skills/cometchat-flutter-v5-events/SKILL.md +1 -1
  134. package/skills/cometchat-flutter-v5-messages/SKILL.md +1 -1
  135. package/skills/cometchat-flutter-v5-production/SKILL.md +1 -1
  136. package/skills/cometchat-flutter-v5-push/SKILL.md +1 -1
  137. package/skills/cometchat-flutter-v5-testing/SKILL.md +390 -0
  138. package/skills/cometchat-flutter-v5-theming/SKILL.md +1 -1
  139. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +1 -1
  140. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +1 -1
  141. package/skills/cometchat-flutter-v6/SKILL.md +1 -1
  142. package/skills/cometchat-flutter-v6-calls/SKILL.md +308 -243
  143. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +134 -0
  144. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +102 -0
  145. package/skills/cometchat-flutter-v6-calls/references/call-session.md +229 -0
  146. package/skills/cometchat-flutter-v6-calls/references/device-management.md +99 -0
  147. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +190 -0
  148. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +80 -0
  149. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +122 -0
  150. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +268 -0
  151. package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +171 -0
  152. package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +93 -0
  153. package/skills/cometchat-flutter-v6-calls/references/share-invite.md +102 -0
  154. package/skills/cometchat-flutter-v6-components/SKILL.md +1 -1
  155. package/skills/cometchat-flutter-v6-conversations/SKILL.md +1 -1
  156. package/skills/cometchat-flutter-v6-core/SKILL.md +1 -1
  157. package/skills/cometchat-flutter-v6-customization/SKILL.md +1 -1
  158. package/skills/cometchat-flutter-v6-events/SKILL.md +1 -1
  159. package/skills/cometchat-flutter-v6-features/SKILL.md +1 -1
  160. package/skills/cometchat-flutter-v6-messages/SKILL.md +1 -1
  161. package/skills/cometchat-flutter-v6-migration/SKILL.md +1 -1
  162. package/skills/cometchat-flutter-v6-placement/SKILL.md +1 -1
  163. package/skills/cometchat-flutter-v6-production/SKILL.md +1 -1
  164. package/skills/cometchat-flutter-v6-push/SKILL.md +452 -0
  165. package/skills/cometchat-flutter-v6-testing/SKILL.md +319 -0
  166. package/skills/cometchat-flutter-v6-theming/SKILL.md +1 -1
  167. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +1 -1
  168. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +1 -1
  169. package/skills/cometchat-i18n/SKILL.md +358 -0
  170. package/skills/cometchat-ios/SKILL.md +5 -5
  171. package/skills/cometchat-ios-calls/SKILL.md +409 -0
  172. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +172 -0
  173. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +189 -0
  174. package/skills/cometchat-ios-calls/references/call-layouts.md +136 -0
  175. package/skills/cometchat-ios-calls/references/call-session.md +221 -0
  176. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +353 -0
  177. package/skills/cometchat-ios-calls/references/custom-ui.md +322 -0
  178. package/skills/cometchat-ios-calls/references/device-management.md +171 -0
  179. package/skills/cometchat-ios-calls/references/group-calls.md +396 -0
  180. package/skills/cometchat-ios-calls/references/idle-timeout.md +185 -0
  181. package/skills/cometchat-ios-calls/references/in-call-chat.md +183 -0
  182. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +138 -0
  183. package/skills/cometchat-ios-calls/references/picture-in-picture.md +246 -0
  184. package/skills/cometchat-ios-calls/references/raise-hand.md +239 -0
  185. package/skills/cometchat-ios-calls/references/recording-screen-share.md +339 -0
  186. package/skills/cometchat-ios-calls/references/ringing-integration.md +142 -0
  187. package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +267 -0
  188. package/skills/cometchat-ios-calls/references/share-invite.md +152 -0
  189. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +246 -0
  190. package/skills/cometchat-ios-calls/references/voip-cert-setup.md +166 -0
  191. package/skills/cometchat-ios-components/SKILL.md +1 -1
  192. package/skills/cometchat-ios-core/SKILL.md +1 -1
  193. package/skills/cometchat-ios-customization/SKILL.md +1 -1
  194. package/skills/cometchat-ios-features/SKILL.md +1 -1
  195. package/skills/cometchat-ios-placement/SKILL.md +1 -1
  196. package/skills/cometchat-ios-production/SKILL.md +1 -1
  197. package/skills/cometchat-ios-push/SKILL.md +1 -1
  198. package/skills/cometchat-ios-testing/SKILL.md +371 -0
  199. package/skills/cometchat-ios-theming/SKILL.md +1 -1
  200. package/skills/cometchat-ios-troubleshooting/SKILL.md +1 -1
  201. package/skills/cometchat-native-bare-patterns/SKILL.md +45 -3
  202. package/skills/cometchat-native-calls/SKILL.md +599 -0
  203. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +203 -0
  204. package/skills/cometchat-native-calls/references/call-layouts.md +124 -0
  205. package/skills/cometchat-native-calls/references/call-session.md +182 -0
  206. package/skills/cometchat-native-calls/references/custom-ui.md +250 -0
  207. package/skills/cometchat-native-calls/references/device-management.md +135 -0
  208. package/skills/cometchat-native-calls/references/expo-vs-bare.md +179 -0
  209. package/skills/cometchat-native-calls/references/group-calls.md +291 -0
  210. package/skills/cometchat-native-calls/references/idle-timeout.md +128 -0
  211. package/skills/cometchat-native-calls/references/in-call-chat.md +143 -0
  212. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +72 -0
  213. package/skills/cometchat-native-calls/references/picture-in-picture.md +276 -0
  214. package/skills/cometchat-native-calls/references/raise-hand.md +203 -0
  215. package/skills/cometchat-native-calls/references/recording-screen-share.md +290 -0
  216. package/skills/cometchat-native-calls/references/ringing-integration.md +118 -0
  217. package/skills/cometchat-native-calls/references/server-push-bridge.md +135 -0
  218. package/skills/cometchat-native-calls/references/server-push-payloads.md +193 -0
  219. package/skills/cometchat-native-calls/references/share-invite.md +144 -0
  220. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +317 -0
  221. package/skills/cometchat-native-components/SKILL.md +1 -1
  222. package/skills/cometchat-native-core/SKILL.md +1 -1
  223. package/skills/cometchat-native-customization/SKILL.md +1 -1
  224. package/skills/cometchat-native-expo-patterns/SKILL.md +18 -1
  225. package/skills/cometchat-native-features/SKILL.md +1 -1
  226. package/skills/cometchat-native-placement/SKILL.md +1 -1
  227. package/skills/cometchat-native-production/SKILL.md +1 -1
  228. package/skills/cometchat-native-push/SKILL.md +1 -1
  229. package/skills/cometchat-native-testing/SKILL.md +1 -1
  230. package/skills/cometchat-native-theming/SKILL.md +1 -1
  231. package/skills/cometchat-native-troubleshooting/SKILL.md +1 -1
  232. package/skills/cometchat-nextjs-patterns/SKILL.md +1 -1
  233. package/skills/cometchat-placement/SKILL.md +29 -1
  234. package/skills/cometchat-production/SKILL.md +1 -1
  235. package/skills/cometchat-react-calls/SKILL.md +539 -0
  236. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +145 -0
  237. package/skills/cometchat-react-calls/references/call-layouts.md +161 -0
  238. package/skills/cometchat-react-calls/references/call-session.md +235 -0
  239. package/skills/cometchat-react-calls/references/custom-ui.md +201 -0
  240. package/skills/cometchat-react-calls/references/device-management.md +206 -0
  241. package/skills/cometchat-react-calls/references/group-calls.md +262 -0
  242. package/skills/cometchat-react-calls/references/idle-timeout.md +175 -0
  243. package/skills/cometchat-react-calls/references/in-call-chat.md +212 -0
  244. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +172 -0
  245. package/skills/cometchat-react-calls/references/picture-in-picture.md +245 -0
  246. package/skills/cometchat-react-calls/references/raise-hand.md +238 -0
  247. package/skills/cometchat-react-calls/references/recording-screen-share.md +143 -0
  248. package/skills/cometchat-react-calls/references/ringing-integration.md +255 -0
  249. package/skills/cometchat-react-calls/references/server-web-push-vapid.md +241 -0
  250. package/skills/cometchat-react-calls/references/share-invite.md +176 -0
  251. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +198 -0
  252. package/skills/cometchat-react-calls/references/voip-and-web-push.md +165 -0
  253. package/skills/cometchat-react-patterns/SKILL.md +56 -8
  254. package/skills/cometchat-react-push/SKILL.md +448 -0
  255. package/skills/cometchat-react-router-patterns/SKILL.md +1 -1
  256. package/skills/cometchat-react-testing/SKILL.md +404 -0
  257. package/skills/cometchat-theming/SKILL.md +3 -3
  258. 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