@cometchat/skills 4.3.0 → 4.4.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 (233) hide show
  1. package/LICENSE +21 -0
  2. package/bin/install.js +27 -0
  3. package/package.json +14 -1
  4. package/skills/cometchat/SKILL.md +233 -69
  5. package/skills/cometchat/references/asking-questions.md +48 -0
  6. package/skills/cometchat-a11y/SKILL.md +3 -2
  7. package/skills/cometchat-android-v5/SKILL.md +2 -1
  8. package/skills/cometchat-android-v5-calls/SKILL.md +36 -22
  9. package/skills/cometchat-android-v5-calls/references/README.md +1 -1
  10. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +7 -5
  11. package/skills/cometchat-android-v5-calls/references/audio-controls.md +4 -4
  12. package/skills/cometchat-android-v5-calls/references/call-layouts.md +33 -25
  13. package/skills/cometchat-android-v5-calls/references/call-session.md +2 -2
  14. package/skills/cometchat-android-v5-calls/references/custom-ui.md +5 -5
  15. package/skills/cometchat-android-v5-calls/references/event-listeners.md +2 -2
  16. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +20 -14
  17. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +1 -1
  18. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +43 -27
  19. package/skills/cometchat-android-v5-calls/references/participant-management.md +3 -3
  20. package/skills/cometchat-android-v5-calls/references/raise-hand.md +25 -19
  21. package/skills/cometchat-android-v5-calls/references/recording.md +2 -2
  22. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +1 -1
  23. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +5 -9
  24. package/skills/cometchat-android-v5-calls/references/session-settings.md +3 -3
  25. package/skills/cometchat-android-v5-calls/references/setup.md +1 -1
  26. package/skills/cometchat-android-v5-calls/references/share-invite.md +9 -4
  27. package/skills/cometchat-android-v5-calls/references/video-controls.md +4 -4
  28. package/skills/cometchat-android-v5-calls/references/voip-calling.md +2 -2
  29. package/skills/cometchat-android-v5-components/SKILL.md +4 -3
  30. package/skills/cometchat-android-v5-core/SKILL.md +5 -3
  31. package/skills/cometchat-android-v5-customization/SKILL.md +171 -7
  32. package/skills/cometchat-android-v5-extensions/SKILL.md +7 -4
  33. package/skills/cometchat-android-v5-features/SKILL.md +5 -4
  34. package/skills/cometchat-android-v5-placement/SKILL.md +2 -1
  35. package/skills/cometchat-android-v5-production/SKILL.md +2 -1
  36. package/skills/cometchat-android-v5-push/SKILL.md +2 -3
  37. package/skills/cometchat-android-v5-testing/SKILL.md +2 -1
  38. package/skills/cometchat-android-v5-theming/SKILL.md +2 -1
  39. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +3 -2
  40. package/skills/cometchat-android-v6/SKILL.md +2 -1
  41. package/skills/cometchat-android-v6-builder-settings/SKILL.md +11 -7
  42. package/skills/cometchat-android-v6-calls/SKILL.md +79 -18
  43. package/skills/cometchat-android-v6-calls/references/advanced-features.md +87 -0
  44. package/skills/cometchat-android-v6-calls/references/call-layouts.md +24 -15
  45. package/skills/cometchat-android-v6-calls/references/call-session.md +2 -2
  46. package/skills/cometchat-android-v6-calls/references/device-management.md +17 -16
  47. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +7 -4
  48. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +13 -8
  49. package/skills/cometchat-android-v6-calls/references/raise-hand.md +6 -4
  50. package/skills/cometchat-android-v6-compose-components/SKILL.md +52 -29
  51. package/skills/cometchat-android-v6-compose-customization/SKILL.md +156 -1
  52. package/skills/cometchat-android-v6-compose-placement/SKILL.md +129 -40
  53. package/skills/cometchat-android-v6-compose-theming/SKILL.md +27 -1
  54. package/skills/cometchat-android-v6-core/SKILL.md +208 -28
  55. package/skills/cometchat-android-v6-events/SKILL.md +4 -1
  56. package/skills/cometchat-android-v6-extensions/SKILL.md +2 -1
  57. package/skills/cometchat-android-v6-features/SKILL.md +26 -2
  58. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +31 -1
  59. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +172 -1
  60. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +20 -5
  61. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +36 -5
  62. package/skills/cometchat-android-v6-migration/SKILL.md +44 -42
  63. package/skills/cometchat-android-v6-production/SKILL.md +6 -3
  64. package/skills/cometchat-android-v6-push/SKILL.md +43 -2
  65. package/skills/cometchat-android-v6-testing/SKILL.md +11 -8
  66. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +26 -5
  67. package/skills/cometchat-angular-calls/SKILL.md +256 -389
  68. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +3 -2
  69. package/skills/cometchat-angular-calls/references/call-layouts.md +29 -12
  70. package/skills/cometchat-angular-calls/references/call-session.md +2 -2
  71. package/skills/cometchat-angular-calls/references/custom-ui.md +18 -10
  72. package/skills/cometchat-angular-calls/references/device-management.md +53 -34
  73. package/skills/cometchat-angular-calls/references/group-calls.md +45 -24
  74. package/skills/cometchat-angular-calls/references/idle-timeout.md +31 -15
  75. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +7 -6
  76. package/skills/cometchat-angular-calls/references/raise-hand.md +9 -4
  77. package/skills/cometchat-angular-calls/references/recording-screen-share.md +32 -39
  78. package/skills/cometchat-angular-calls/references/ringing-integration.md +3 -1
  79. package/skills/cometchat-angular-calls/references/share-invite.md +11 -5
  80. package/skills/cometchat-angular-calls/references/virtual-background.md +29 -0
  81. package/skills/cometchat-angular-components/SKILL.md +149 -620
  82. package/skills/cometchat-angular-core/SKILL.md +232 -312
  83. package/skills/cometchat-angular-customization/SKILL.md +415 -223
  84. package/skills/cometchat-angular-features/SKILL.md +216 -334
  85. package/skills/cometchat-angular-patterns/SKILL.md +168 -359
  86. package/skills/cometchat-angular-placement/SKILL.md +189 -560
  87. package/skills/cometchat-angular-production/SKILL.md +241 -92
  88. package/skills/cometchat-angular-push/SKILL.md +280 -294
  89. package/skills/cometchat-angular-testing/SKILL.md +430 -158
  90. package/skills/cometchat-angular-theming/SKILL.md +190 -265
  91. package/skills/cometchat-angular-troubleshooting/SKILL.md +192 -157
  92. package/skills/cometchat-astro-patterns/SKILL.md +2 -1
  93. package/skills/cometchat-calls/SKILL.md +25 -19
  94. package/skills/cometchat-calls/references/use-case-broadcast.md +15 -10
  95. package/skills/cometchat-calls/references/use-case-marketplace.md +2 -3
  96. package/skills/cometchat-calls/references/use-case-support.md +3 -4
  97. package/skills/cometchat-calls/references/use-case-team.md +23 -12
  98. package/skills/cometchat-calls/references/use-case-telehealth.md +3 -4
  99. package/skills/cometchat-components/SKILL.md +163 -25
  100. package/skills/cometchat-core/SKILL.md +255 -19
  101. package/skills/cometchat-customization/SKILL.md +50 -25
  102. package/skills/cometchat-features/SKILL.md +313 -34
  103. package/skills/cometchat-flutter-v5/SKILL.md +10 -4
  104. package/skills/cometchat-flutter-v5-calls/SKILL.md +188 -158
  105. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +48 -24
  106. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +20 -15
  107. package/skills/cometchat-flutter-v5-calls/references/call-session.md +100 -145
  108. package/skills/cometchat-flutter-v5-calls/references/device-management.md +12 -8
  109. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +30 -36
  110. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +15 -13
  111. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +12 -9
  112. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +115 -65
  113. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +41 -30
  114. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +17 -14
  115. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +8 -2
  116. package/skills/cometchat-flutter-v5-conversations/SKILL.md +2 -1
  117. package/skills/cometchat-flutter-v5-core/SKILL.md +5 -4
  118. package/skills/cometchat-flutter-v5-customization/SKILL.md +136 -5
  119. package/skills/cometchat-flutter-v5-events/SKILL.md +2 -1
  120. package/skills/cometchat-flutter-v5-messages/SKILL.md +2 -1
  121. package/skills/cometchat-flutter-v5-production/SKILL.md +15 -6
  122. package/skills/cometchat-flutter-v5-push/SKILL.md +2 -1
  123. package/skills/cometchat-flutter-v5-testing/SKILL.md +17 -6
  124. package/skills/cometchat-flutter-v5-theming/SKILL.md +2 -1
  125. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +7 -6
  126. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +3 -2
  127. package/skills/cometchat-flutter-v6/SKILL.md +17 -16
  128. package/skills/cometchat-flutter-v6-calls/SKILL.md +72 -57
  129. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +5 -3
  130. package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +89 -0
  131. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +15 -12
  132. package/skills/cometchat-flutter-v6-calls/references/call-session.md +2 -2
  133. package/skills/cometchat-flutter-v6-calls/references/device-management.md +9 -3
  134. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +10 -10
  135. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +15 -7
  136. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +6 -3
  137. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +23 -16
  138. package/skills/cometchat-flutter-v6-components/SKILL.md +32 -11
  139. package/skills/cometchat-flutter-v6-conversations/SKILL.md +39 -11
  140. package/skills/cometchat-flutter-v6-core/SKILL.md +182 -21
  141. package/skills/cometchat-flutter-v6-customization/SKILL.md +97 -25
  142. package/skills/cometchat-flutter-v6-events/SKILL.md +3 -2
  143. package/skills/cometchat-flutter-v6-features/SKILL.md +15 -6
  144. package/skills/cometchat-flutter-v6-messages/SKILL.md +111 -60
  145. package/skills/cometchat-flutter-v6-migration/SKILL.md +18 -25
  146. package/skills/cometchat-flutter-v6-placement/SKILL.md +79 -50
  147. package/skills/cometchat-flutter-v6-production/SKILL.md +13 -12
  148. package/skills/cometchat-flutter-v6-push/SKILL.md +41 -19
  149. package/skills/cometchat-flutter-v6-testing/SKILL.md +4 -4
  150. package/skills/cometchat-flutter-v6-theming/SKILL.md +38 -5
  151. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +182 -17
  152. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +12 -4
  153. package/skills/cometchat-i18n/SKILL.md +139 -78
  154. package/skills/cometchat-ios/SKILL.md +4 -2
  155. package/skills/cometchat-ios-calls/SKILL.md +225 -95
  156. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +11 -9
  157. package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +45 -0
  158. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +6 -7
  159. package/skills/cometchat-ios-calls/references/call-layouts.md +31 -91
  160. package/skills/cometchat-ios-calls/references/call-session.md +51 -54
  161. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +33 -29
  162. package/skills/cometchat-ios-calls/references/custom-ui.md +38 -38
  163. package/skills/cometchat-ios-calls/references/group-calls.md +33 -70
  164. package/skills/cometchat-ios-calls/references/idle-timeout.md +24 -25
  165. package/skills/cometchat-ios-calls/references/in-call-chat.md +19 -23
  166. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +128 -70
  167. package/skills/cometchat-ios-calls/references/picture-in-picture.md +20 -20
  168. package/skills/cometchat-ios-calls/references/raise-hand.md +14 -227
  169. package/skills/cometchat-ios-calls/references/recording-screen-share.md +35 -122
  170. package/skills/cometchat-ios-calls/references/ringing-integration.md +17 -16
  171. package/skills/cometchat-ios-calls/references/share-invite.md +8 -12
  172. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +4 -4
  173. package/skills/cometchat-ios-components/SKILL.md +200 -12
  174. package/skills/cometchat-ios-core/SKILL.md +173 -45
  175. package/skills/cometchat-ios-customization/SKILL.md +276 -110
  176. package/skills/cometchat-ios-features/SKILL.md +64 -36
  177. package/skills/cometchat-ios-placement/SKILL.md +15 -12
  178. package/skills/cometchat-ios-production/SKILL.md +12 -4
  179. package/skills/cometchat-ios-push/SKILL.md +53 -19
  180. package/skills/cometchat-ios-testing/SKILL.md +14 -9
  181. package/skills/cometchat-ios-theming/SKILL.md +39 -3
  182. package/skills/cometchat-ios-troubleshooting/SKILL.md +41 -21
  183. package/skills/cometchat-native-bare-patterns/SKILL.md +34 -17
  184. package/skills/cometchat-native-calls/SKILL.md +28 -16
  185. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +2 -2
  186. package/skills/cometchat-native-calls/references/call-layouts.md +15 -14
  187. package/skills/cometchat-native-calls/references/call-session.md +2 -2
  188. package/skills/cometchat-native-calls/references/custom-ui.md +12 -8
  189. package/skills/cometchat-native-calls/references/device-management.md +53 -30
  190. package/skills/cometchat-native-calls/references/group-calls.md +35 -30
  191. package/skills/cometchat-native-calls/references/idle-timeout.md +6 -6
  192. package/skills/cometchat-native-calls/references/in-call-chat.md +10 -8
  193. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +2 -2
  194. package/skills/cometchat-native-calls/references/raise-hand.md +15 -13
  195. package/skills/cometchat-native-calls/references/recording-screen-share.md +49 -170
  196. package/skills/cometchat-native-calls/references/share-invite.md +7 -5
  197. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +4 -2
  198. package/skills/cometchat-native-components/SKILL.md +84 -52
  199. package/skills/cometchat-native-core/SKILL.md +101 -32
  200. package/skills/cometchat-native-customization/SKILL.md +150 -28
  201. package/skills/cometchat-native-expo-patterns/SKILL.md +57 -26
  202. package/skills/cometchat-native-features/SKILL.md +23 -16
  203. package/skills/cometchat-native-placement/SKILL.md +19 -10
  204. package/skills/cometchat-native-production/SKILL.md +9 -3
  205. package/skills/cometchat-native-push/SKILL.md +2 -1
  206. package/skills/cometchat-native-testing/SKILL.md +1 -2
  207. package/skills/cometchat-native-theming/SKILL.md +54 -29
  208. package/skills/cometchat-native-troubleshooting/SKILL.md +9 -3
  209. package/skills/cometchat-nextjs-patterns/SKILL.md +20 -6
  210. package/skills/cometchat-placement/SKILL.md +42 -3
  211. package/skills/cometchat-production/SKILL.md +12 -5
  212. package/skills/cometchat-react-calls/SKILL.md +220 -10
  213. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +4 -3
  214. package/skills/cometchat-react-calls/references/call-layouts.md +5 -6
  215. package/skills/cometchat-react-calls/references/call-session.md +1 -1
  216. package/skills/cometchat-react-calls/references/custom-ui.md +61 -15
  217. package/skills/cometchat-react-calls/references/device-management.md +55 -51
  218. package/skills/cometchat-react-calls/references/group-calls.md +18 -23
  219. package/skills/cometchat-react-calls/references/idle-timeout.md +25 -12
  220. package/skills/cometchat-react-calls/references/in-call-chat.md +7 -7
  221. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +9 -11
  222. package/skills/cometchat-react-calls/references/raise-hand.md +14 -14
  223. package/skills/cometchat-react-calls/references/recording-screen-share.md +39 -38
  224. package/skills/cometchat-react-calls/references/ringing-integration.md +2 -2
  225. package/skills/cometchat-react-calls/references/share-invite.md +4 -5
  226. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +20 -2
  227. package/skills/cometchat-react-calls/references/virtual-background.md +32 -0
  228. package/skills/cometchat-react-patterns/SKILL.md +44 -4
  229. package/skills/cometchat-react-push/SKILL.md +258 -72
  230. package/skills/cometchat-react-router-patterns/SKILL.md +10 -4
  231. package/skills/cometchat-react-testing/SKILL.md +14 -5
  232. package/skills/cometchat-theming/SKILL.md +181 -18
  233. package/skills/cometchat-troubleshooting/SKILL.md +40 -20
@@ -61,8 +61,8 @@ import CometChatSDK
61
61
 
62
62
  func initiateGroupCall(guid: String, isVideo: Bool) async throws -> Call {
63
63
  let group = try await fetchGroup(guid)
64
- let callType: CallType = isVideo ? .video : .voice
65
- let call = Call(receiverUid: group.guid, receiverType: .group, callType: callType)
64
+ let callType: CallType = isVideo ? .video : .audio // CallType has no .voice
65
+ let call = Call(receiverId: group.guid, callType: callType, receiverType: .group)
66
66
 
67
67
  return try await withCheckedThrowingContinuation { cont in
68
68
  CometChat.initiateCall(call: call,
@@ -122,35 +122,28 @@ Diffable data source means roster updates animate cleanly without cell-recreatio
122
122
 
123
123
  ---
124
124
 
125
- ## Active-speaker observation
125
+ ## Participant-roster observation
126
126
 
127
- `CometChatCallsSDK` exposes the active-speaker callback via `CometChatCallsEventsListener`. Wrap it for SwiftUI/Combine:
127
+ > **The iOS Calls SDK v5 has NO active-speaker callback.** `CallsEventsDelegate` exposes no `onActiveSpeakerUpdated` (and no `onUserListUpdated`). If you want an active-speaker spotlight on iOS, the SDK won't drive it — use the SDK's built-in spotlight mode instead (set via `CallSettingsBuilder.setMode(.spotlight)` the typed `DisplayModes` enum, swiftinterface:175/281), which the SDK lays out internally.
128
+
129
+ For a custom roster, observe the participant callbacks that DO exist — use the TYPED forms `onUserJoined(rtcUser:)`, `onUserLeft(rtcUser:)`, `onUserListChanged(rtcUsers:)` (swiftinterface:35,38,41). They deliver `RTCUser` objects (swiftinterface:139 — `uid`, `avatar`, `name`, `jwt`, `resource`), so read typed properties instead of parsing dictionaries. The `NSDictionary`/`NSArray` forms are DEPRECATED.
128
130
 
129
131
  ```swift
130
- final class CallStateObserver: ObservableObject {
131
- @Published var activeSpeakerUid: String?
132
- @Published var participants: [Participant] = []
132
+ import CometChatCallsSDK
133
133
 
134
- private var debounceTimer: Timer?
134
+ final class CallStateObserver: NSObject, ObservableObject, CallsEventsDelegate {
135
+ @Published var participants: [RTCUser] = []
135
136
 
136
- func onActiveSpeakerUpdated(_ uid: String) {
137
- debounceTimer?.invalidate()
138
- debounceTimer = Timer.scheduledTimer(withTimeInterval: 0.5, repeats: false) { [weak self] _ in
139
- DispatchQueue.main.async {
140
- self?.activeSpeakerUid = uid
141
- }
142
- }
143
- }
144
-
145
- func onUserListUpdated(_ users: [Participant]) {
137
+ // swiftinterface:41 onUserListChanged(rtcUsers: [RTCUser])
138
+ func onUserListChanged(rtcUsers: [RTCUser]) {
146
139
  DispatchQueue.main.async {
147
- self.participants = users
140
+ self.participants = rtcUsers
148
141
  }
149
142
  }
150
143
  }
151
144
  ```
152
145
 
153
- 500ms debounce same rule as RN/Angular. Without it, the spotlight tile jitters.
146
+ Wire it via `CallSettingsBuilder.setDelegate(self)` or `CometChatCalls.addCallEventListener(observerId:delegate:)`.
154
147
 
155
148
  `@Published` works in both SwiftUI (via `@StateObject`) and UIKit (via Combine subscriptions). Pick one path; don't mix.
156
149
 
@@ -202,63 +195,35 @@ The `Identifiable` conformance on `Participant` (with `id = uid`) is what makes
202
195
 
203
196
  ---
204
197
 
205
- ## Moderator actions — UIKit Action Sheet
206
-
207
- ```swift
208
- extension GroupCallViewController {
209
- @objc func participantTapped(_ sender: UITapGestureRecognizer) {
210
- guard let cell = sender.view as? ParticipantCell,
211
- let participant = cell.participant else { return }
212
- guard canModerate else { return } // gate
213
-
214
- let alert = UIAlertController(title: participant.name, message: nil, preferredStyle: .actionSheet)
215
- alert.addAction(UIAlertAction(title: "Mute", style: .default) { _ in
216
- Task { try? await CometChatCalls.muteUser(uid: participant.uid) }
217
- })
218
- alert.addAction(UIAlertAction(title: "Remove from call", style: .destructive) { _ in
219
- Task { try? await CometChatCalls.removeUser(uid: participant.uid) }
220
- })
221
- alert.addAction(UIAlertAction(title: "Cancel", style: .cancel))
222
-
223
- if let popover = alert.popoverPresentationController {
224
- popover.sourceView = cell
225
- popover.sourceRect = cell.bounds
226
- }
227
- present(alert, animated: true)
228
- }
198
+ ## Moderator actions — not in the Calls SDK
229
199
 
230
- private var canModerate: Bool {
231
- return group?.scope == "admin" || group?.scope == "moderator"
232
- }
233
- }
234
- ```
200
+ > **There are NO in-call moderator APIs on the iOS Calls SDK v5.** `CometChatCalls` has no `muteUser(uid:)` and no `removeUser(uid:)` (verified against the `CometChatCallsSDK` swiftinterface). Do not scaffold these — they won't compile.
235
201
 
236
- `popoverPresentationController` is required on iPad without it, action sheets crash on iPad.
202
+ If you need remote mute / kick semantics, route them through the **Chat SDK group APIs** (e.g. `CometChat.kickGroupMember` / `banGroupMember`) or the **REST API** for group membership, and treat "muted" as app-level state you broadcast over a custom/transient message and apply locally. The Calls SDK is not involved in moderation.
237
203
 
238
204
  ---
239
205
 
240
206
  ## Capacity error handling
241
207
 
208
+ `CallsEventsDelegate` has NO `onError` callback. Capacity / membership errors surface from the `onError` closures of `generateToken` and `startSession` as a `CometChatCallException` — handle them there:
209
+
242
210
  ```swift
243
211
  final class GroupCallViewController: UIViewController {
244
- func setupCallListener() {
245
- let listener = CometChatCallsEventsListener()
246
- listener.onError = { [weak self] error in
247
- DispatchQueue.main.async {
248
- switch error.code {
249
- case "ERR_CALL_FULL":
250
- self?.showAlert(title: "Call is full",
251
- message: "This meeting has reached its participant limit.")
252
- case "ERR_NOT_GROUP_MEMBER":
253
- self?.showAlert(title: "Not a member",
254
- message: "You're not a member of this group.")
255
- default:
256
- self?.showAlert(title: "Call error", message: error.message)
257
- }
212
+ func handleStartError(_ error: CometChatCallException?) {
213
+ DispatchQueue.main.async { [weak self] in
214
+ switch error?.errorCode {
215
+ case "ERR_CALL_FULL":
216
+ self?.showAlert(title: "Call is full",
217
+ message: "This meeting has reached its participant limit.")
218
+ case "ERR_NOT_GROUP_MEMBER":
219
+ self?.showAlert(title: "Not a member",
220
+ message: "You're not a member of this group.")
221
+ default:
222
+ self?.showAlert(title: "Call error", message: error?.errorDescription ?? "Unknown error")
258
223
  }
259
224
  }
260
- // ...
261
225
  }
226
+ // Pass handleStartError to the onError of generateToken / startSession.
262
227
 
263
228
  private func showAlert(title: String, message: String) {
264
229
  let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
@@ -312,11 +277,9 @@ NotificationCenter.default.addObserver(
312
277
 
313
278
  @objc func powerStateChanged() {
314
279
  if ProcessInfo.processInfo.isLowPowerModeEnabled && callActive {
315
- Task {
316
- await CometChatCalls.pauseVideo(true)
317
- DispatchQueue.main.async {
318
- self.showBanner("Video paused — Low Power Mode")
319
- }
280
+ CometChatCalls.videoPaused(true) // NOT pauseVideo; synchronous
281
+ DispatchQueue.main.async {
282
+ self.showBanner("Video paused — Low Power Mode")
320
283
  }
321
284
  }
322
285
  }
@@ -1,37 +1,33 @@
1
1
  # Idle timeout on iOS
2
2
 
3
- Same SDK API as web `idleTimeoutPeriodBeforePrompt` / `idleTimeoutPeriodAfterPrompt` on `CallSettingsBuilder`, `onSessionTimedOut` event. iOS-specific deltas: CallKit interaction (idle timeout doesn't end the OS-level call card automatically; you have to report end to CallKit), foreground/background interplay (iOS can suspend the call session in background), and SwiftUI/UIKit prompt UI.
3
+ The iOS Calls SDK v5 has a real idle-timeout API. Set it on the builder with `setIdleTimeoutPeriod(_ value: Int) -> Self` (swiftinterface:289), and react to the timeout via the optional `CallsEventsDelegate.onSessionTimeout()` callback (swiftinterface:30). The SDK runs the timer; you do NOT hand-roll a client-side `Timer`. (If you want an "are you still there?" prompt BEFORE the SDK ends the session, you can still drive a softer client-side warning off participant events but the timeout itself is the SDK's job.)
4
4
 
5
5
  **Canonical docs:** https://www.cometchat.com/docs/calls/ios/idle-timeout
6
6
  **Read first:** `cometchat-react-calls/references/idle-timeout.md` — settings + archetype timeouts + Pattern A custom timer.
7
7
 
8
8
  ---
9
9
 
10
- ## SDK API
10
+ ## SDK idle timeout — `setIdleTimeoutPeriod` + `onSessionTimeout`
11
+
12
+ Set the timeout (in seconds) on the builder, then react to the SDK's `onSessionTimeout()` callback. When it fires, report the end to CallKit and the SDK has already torn the session down:
11
13
 
12
14
  ```swift
13
15
  import CometChatCallsSDK
14
16
 
15
17
  let settings = CallSettingsBuilder()
16
- .setSessionType(.video)
17
- .setIsAudioOnly(false)
18
- .setIdleTimeoutPeriodBeforePrompt(60_000) // ms
19
- .setIdleTimeoutPeriodAfterPrompt(120_000)
18
+ .setIdleTimeoutPeriod(120) // swiftinterface:289 setIdleTimeoutPeriod(_ value: Int) -> Self
19
+ .setDelegate(callListener)
20
20
  .build()
21
- ```
22
-
23
- Listener — implement on the `CometChatCallsEventsListener`:
21
+ // ... generateToken → startSession(callToken:callSetting:view:) ...
24
22
 
25
- ```swift
26
- class CallListener: NSObject, CometChatCallsEventsListener {
27
- func onSessionTimedOut() {
23
+ class CallListener: NSObject, CallsEventsDelegate {
24
+ // swiftinterface:30 optional CallsEventsDelegate.onSessionTimeout()
25
+ func onSessionTimeout() {
28
26
  DispatchQueue.main.async {
29
- // Report end to CallKit (rule 1.5 — hangup cleanup)
30
- CallManager.shared.endCall(reason: .answeredElsewhere)
31
- // Navigate away
27
+ // Report end to CallKit (rule 1.5 — hangup cleanup); SDK already ended the session.
28
+ CallManager.shared.endCall(reason: .remoteEnded)
32
29
  }
33
30
  }
34
- // ...
35
31
  }
36
32
  ```
37
33
 
@@ -41,7 +37,7 @@ The `CallManager.shared.endCall(reason:)` call is critical — see `references/c
41
37
 
42
38
  ## CallKit interaction — endCall reason
43
39
 
44
- When the SDK fires `onSessionTimedOut`, you must report the call end to CallKit. The reason matters for system UI:
40
+ When your client-side timer fires, you must report the call end to CallKit. The reason matters for system UI:
45
41
 
46
42
  ```swift
47
43
  let endReason: CXCallEndedReason = .remoteEnded
@@ -61,6 +57,8 @@ provider.reportCall(
61
57
 
62
58
  Use `.remoteEnded` for idle timeout — it's the closest semantic match (the "remote" effectively ended the call by leaving). Don't use `.failed` (implies error; iOS shows a "call failed" UI).
63
59
 
60
+ Drive the reporting from your own timer's completion handler — there is no SDK callback to hang this off.
61
+
64
62
  ---
65
63
 
66
64
  ## Foreground/background gotcha
@@ -117,7 +115,7 @@ struct CallView: View {
117
115
  .onTapGesture { /* prevent dismiss on backdrop */ }
118
116
  IdleTimeoutPrompt(
119
117
  onStay: { showIdlePrompt = false; resetIdleTimer() },
120
- onEnd: { CometChatCallsSDK.CallSession.shared.leaveSession() },
118
+ onEnd: { CometChatCalls.endSession() },
121
119
  )
122
120
  }
123
121
  }
@@ -143,7 +141,7 @@ alert.addAction(UIAlertAction(title: "Stay", style: .default) { _ in
143
141
  resetIdleTimer()
144
142
  })
145
143
  alert.addAction(UIAlertAction(title: "End now", style: .destructive) { _ in
146
- CometChatCallsSDK.CallSession.shared.leaveSession()
144
+ CometChatCalls.endSession()
147
145
  })
148
146
  alert.preferredAction = alert.actions.first // make Stay the default
149
147
  present(alert, animated: true)
@@ -157,17 +155,18 @@ present(alert, animated: true)
157
155
 
158
156
  Web sister reference rules apply, plus iOS-specific:
159
157
 
160
- 1. **`onSessionTimedOut` without reporting end to CallKit.** Lock-screen call card persistsuser sees a stuck "ongoing call" until they manually end it.
161
- 2. **Using `.failed` reason for idle timeout end.** iOS shows "call failed" wrong semantic. Use `.remoteEnded`.
162
- 3. **Custom prompt that doesn't dim background.** Calls UI keeps rendering behind the prompt; user can interact with controls and call ends prematurely.
163
- 4. **`UIAlertController` from background queue.** Crashes must be on main. Wrap in `DispatchQueue.main.async`.
158
+ 1. **Hand-rolling a `Timer` for the timeout itself.** The SDK has `setIdleTimeoutPeriod(_:)` (swiftinterface:289) + `onSessionTimeout()` (swiftinterface:30) use them. Only a soft "still there?" warning prompt should be client-side.
159
+ 2. **`onSessionTimeout` firing without reporting end to CallKit.** Lock-screen call card persists — user sees a stuck "ongoing call" until they manually end it.
160
+ 3. **Using `.failed` reason for idle timeout end.** iOS shows "call failed" wrong semantic. Use `.remoteEnded`.
161
+ 4. **Custom prompt that doesn't dim background.** Calls UI keeps rendering behind the prompt; user can interact with controls and call ends prematurely.
162
+ 5. **`UIAlertController` from background queue.** Crashes — must be on main. Wrap in `DispatchQueue.main.async`.
164
163
 
165
164
  ---
166
165
 
167
166
  ## Verification checklist
168
167
 
169
- - [ ] CallSettingsBuilder sets both idle periods
170
- - [ ] `onSessionTimedOut` listener reports end to CallKit with `.remoteEnded` reason
168
+ - [ ] Timeout set via `CallSettingsBuilder.setIdleTimeoutPeriod(_:)` (seconds) no hand-rolled `Timer` for the timeout
169
+ - [ ] `onSessionTimeout()` delegate callback reports end to CallKit with `.remoteEnded` reason
171
170
  - [ ] Custom prompt uses `accessibilityAddTraits(.isModal)` (SwiftUI) or `UIAlertController.preferredStyle = .alert`
172
171
  - [ ] Backdrop dimmed; prevents accidental dismiss
173
172
  - [ ] All UIKit alert presentations on main thread
@@ -1,33 +1,29 @@
1
1
  # In-call chat on iOS
2
2
 
3
- Same SDK shape as web. iOS-specific: `UISheetPresentationController` for the chat sheet (iOS 15+) + AVAudioSession ducking when keyboard is open.
3
+ > **The iOS Calls SDK v5 has NO in-call chat button.** There is no `setHideChatButton` on `CallSettingsBuilder`, no `onChatButtonClicked` callback on `CallsEventsDelegate`, and no `CometChatCalls.setChatButtonUnreadCount(_:)`. None of these symbols exist do not emit them.
4
+
5
+ In-call chat is therefore an **app-level composition**, not an SDK feature: you add your OWN chat button to your call UI, and present a sheet hosting the kit's `CometChatMessageList` + `CometChatMessageComposer` over a group keyed to the call's session ID. The Calls SDK is not involved.
4
6
 
5
7
  **Canonical docs:** https://www.cometchat.com/docs/calls/ios/in-call-chat
6
8
  **Read first:** `cometchat-react-calls/references/in-call-chat.md` — group-as-session architecture + anti-patterns.
7
9
 
8
10
  ---
9
11
 
10
- ## SDK API
12
+ ## Your own chat button (the SDK provides none)
13
+
14
+ Add a button to your call control panel and present the sheet yourself. Track unread count in your own state (from a `CometChat.addMessageListener` on the session group) — there is no SDK badge API.
11
15
 
12
16
  ```swift
13
- import CometChatCallsSDK
14
17
  import CometChatSDK
15
18
 
16
- let settings = CallSettingsBuilder()
17
- .setSessionType(.video)
18
- .setHideChatButton(false)
19
- .build()
20
-
21
- // Chat button event — implement in your CometChatCallsEventsListener
22
- func onChatButtonClicked() {
23
- DispatchQueue.main.async {
24
- self.presentChatSheet()
25
- }
26
- }
19
+ // In your call UIViewController:
20
+ let chatButton = UIButton(type: .system)
21
+ chatButton.addAction(UIAction { [weak self] _ in
22
+ self?.presentChatSheet() // present on main; you're already on main here
23
+ }, for: .touchUpInside)
27
24
 
28
- // Unread badge
29
- CometChatCalls.setChatButtonUnreadCount(5)
30
- CometChatCalls.setChatButtonUnreadCount(0)
25
+ // Unread badge: maintain your own count from a message listener on the session group,
26
+ // and update chatButton's badge view. There is no CometChatCalls.setChatButtonUnreadCount.
31
27
  ```
32
28
 
33
29
  ---
@@ -93,8 +89,8 @@ class InCallChatViewController: UIViewController {
93
89
 
94
90
  override func viewWillDisappear(_ animated: Bool) {
95
91
  super.viewWillDisappear(animated)
96
- // Clear badge on close
97
- CometChatCalls.setChatButtonUnreadCount(0)
92
+ // Clear YOUR unread count on close (no SDK badge API exists).
93
+ NotificationCenter.default.post(name: .inCallChatClosed, object: nil)
98
94
  }
99
95
 
100
96
  private func embedMessageList() {
@@ -155,8 +151,8 @@ Most apps don't need this; the kit's defaults are sensible. Override only if use
155
151
 
156
152
  Web sister rules apply, plus iOS-specific:
157
153
 
158
- 1. **`UIAlertController` instead of sheet for in-call chat.** Wrong UX `UIAlertController` is for confirmations, not extended UIs.
159
- 2. **`present(nav, animated: true)` from background queue.** Crash. Always main queue (covered by `DispatchQueue.main.async` in `onChatButtonClicked`).
154
+ 1. **Wiring `setHideChatButton` / `onChatButtonClicked` / `setChatButtonUnreadCount`.** None exist on iOS v5. Present your own button + sheet; track unread in your own state.
155
+ 2. **`present(nav, animated: true)` from background queue.** Crash. Always main queue.
160
156
  3. **Mutating `group` from background.** `group` updates must be on main; `Task { @MainActor in ... }` or `DispatchQueue.main.async`.
161
157
  4. **Forgetting `dismiss(animated: true)` on call end.** Sheet stays up over the post-call screen — looks broken.
162
158
 
@@ -164,8 +160,8 @@ Web sister rules apply, plus iOS-specific:
164
160
 
165
161
  ## Verification checklist
166
162
 
167
- - [ ] `setHideChatButton(false)` in CallSettings
168
- - [ ] `onChatButtonClicked` presents the chat sheet on main queue
163
+ - [ ] Your OWN chat button presents the sheet (no `setHideChatButton`/`onChatButtonClicked`/`setChatButtonUnreadCount` none exist)
164
+ - [ ] Sheet presented on main queue
169
165
  - [ ] `UISheetPresentationController` with `[.medium(), .large()]` detents (iOS 15+)
170
166
  - [ ] `CometChatMessageList` + `CometChatMessageComposer` embedded as child VCs
171
167
  - [ ] Sheet dismissed on call end
@@ -1,9 +1,11 @@
1
1
  # CometChat Calls iOS SDK v4 → v5 migration
2
2
 
3
- `CometChatCallsSDK` v5 is a drop-in upgrade for v4 — bump the SwiftPM/CocoaPods version, your existing call code still compiles. Migrate to v5 APIs for granular events + simpler init.
3
+ `CometChatCallsSDK` v5 keeps the same session model as v4 — a per-session call token, a `CallSettingsBuilder`, and a static `CometChatCalls` facade. There is **no** `CometChatCalls.login`, **no** `CallSession`/`CallSession.shared`, and **no** `SessionSettings` struct. Auth is per-session via `generateToken`.
4
4
 
5
5
  **Canonical docs:** https://www.cometchat.com/docs/calls/ios/migration-guide-v5
6
6
 
7
+ > Every symbol below is verified against the v5 `CometChatCallsSDK` Swift interface. Do NOT introduce `CallSession`, `joinSession`, `SessionSettings`, `SessionSettingsBuilder`, `CometChatCallsEventsListener`, `muteAudio`/`pauseVideo`, `setLayout`, or `startScreenShare` — none of these exist in v5.
8
+
7
9
  ---
8
10
 
9
11
  ## Step 1 — Bump the SDK
@@ -22,111 +24,167 @@ pod install --repo-update
22
24
 
23
25
  ---
24
26
 
25
- ## Step 2 — Migrate init to plain struct
27
+ ## Step 2 — Init
26
28
 
27
- ```diff
28
- - let callAppSettings = CallAppSettings.Builder()
29
- - .setAppId("APP_ID")
30
- - .setRegion("REGION")
31
- - .build()
32
- - CometChatCalls.init(with: callAppSettings) { error in
33
- - // ...
34
- - }
35
-
36
- + let settings = CallAppSettings(appId: "APP_ID", region: "REGION")
37
- + try await CometChatCalls.init(with: settings)
29
+ Init takes a `CallAppSettings` built with `CallAppSettingsBuilder`, passed under the `callsAppSettings:` label (note the `s` — `callsAppSettings`, not `callAppSettings`).
30
+
31
+ ```swift
32
+ let callAppSettings = CallAppSettingsBuilder()
33
+ .setAppId("APP_ID")
34
+ .setRegion("REGION")
35
+ .build()
36
+
37
+ CometChatCalls.init(callsAppSettings: callAppSettings, onSuccess: { _ in
38
+ // ready
39
+ }, onError: { error in
40
+ // surface error
41
+ })
38
42
  ```
39
43
 
40
- V5 ships async/await. The completion-handler form still works for backwards compat.
44
+ There is no async/await `init(with:)` form and no `CallAppSettings.Builder()` nested type — use `CallAppSettingsBuilder()`.
41
45
 
42
46
  ---
43
47
 
44
- ## Step 3 — Add Calls SDK login
48
+ ## Step 3 — Auth is per-session (no Calls SDK login)
49
+
50
+ > **There is NO `CometChatCalls.login` and NO `CometChatCalls.getLoggedInUser` in v5.** Do not call them — they do not exist on the Calls SDK.
51
+
52
+ Authentication is per call session. Get a call token immediately before starting a session:
45
53
 
46
54
  ```swift
47
- // After CometChat.login() resolves with a User:
48
- let authToken = user.authToken
49
- try await CometChatCalls.login(authToken: authToken)
55
+ // Chat SDK still owns the user session. Get its auth token from the Chat SDK:
56
+ let authToken = CometChat.getUserAuthToken() // CometChatSDK — User has NO `authToken` property
57
+
58
+ CometChatCalls.generateToken(authToken: authToken, sessionID: sessionID, onSuccess: { token in
59
+ // `token` is the call token you pass to startSession
60
+ }, onError: { error in
61
+ // surface error
62
+ })
50
63
  ```
51
64
 
52
- After this, `generateToken()` and `joinSession()` no longer need an authToken parameter.
65
+ `generateToken` is `CometChatCalls.generateToken(authToken:sessionID:onSuccess:onError:)`.
53
66
 
54
67
  ---
55
68
 
56
- ## Step 4 — Migrate session settings
69
+ ## Step 4 — Session settings (`CallSettingsBuilder`, not `SessionSettings`)
57
70
 
58
- ```diff
59
- - let callSettings = CallSettings.Builder()
60
- - .setSessionType(.video)
61
- - .startWithAudioMuted(false)
62
- - .showRecordingButton(true)
63
- - .build()
64
-
65
- + let sessionSettings = SessionSettings(
66
- + sessionType: .video,
67
- + startAudioMuted: false,
68
- + hideRecordingButton: false, // INVERTED — was showRecordingButton(true)
69
- + layout: .tile
70
- + )
71
+ > **There is NO `SessionSettings` struct and NO `SessionSettingsBuilder`.** Use `CallSettingsBuilder().build()` which returns `CallSettings`.
72
+
73
+ ```swift
74
+ let callSettings = CallSettingsBuilder()
75
+ .setIsAudioOnly(false) // was setSessionType(.video) — there is no setSessionType
76
+ .setStartAudioMuted(false)
77
+ .setStartVideoMuted(false)
78
+ .setShowRecordingButton(true) // NOT inverted there is no hideRecordingButton
79
+ .setMode(.default) // setMode(_ value: DisplayModes) — swiftinterface:281 (.default/.single/.spotlight); NSString overload is deprecated
80
+ .setDelegate(self) // self conforms to CallsEventsDelegate
81
+ .build()
71
82
  ```
72
83
 
84
+ There is no `setLayout`, no `setHideChatButton`, no `enableRecording`. Recording-button visibility is `setShowRecordingButton(_:)`; auto-record on start is `setStartRecordingOnCallStart(_:)`.
85
+
73
86
  ---
74
87
 
75
- ## Step 5 — Migrate events to delegates / closures
88
+ ## Step 5 — Start / end the session
76
89
 
77
- ```diff
78
- - // v4: implementing CometChatCallsEventsListener with all callbacks
79
- - class MyCallEvents: CometChatCallsEventsListener {
80
- - func onCallEnded() { /* ... */ }
81
- - func onUserJoined(user: User) { /* ... */ }
82
- - func onUserLeft(user: User) { /* ... */ }
83
- - func onError(error: Error) { /* ... */ }
84
- - }
85
-
86
- + // v5: granular subscriptions
87
- + let unsub1 = CometChatCalls.addEventListener(.sessionLeft) { _ in /* ... */ }
88
- + let unsub2 = CometChatCalls.addEventListener(.participantJoined) { participant in /* ... */ }
89
- + let unsub3 = CometChatCalls.addEventListener(.participantLeft) { participant in /* ... */ }
90
- +
91
- + // Cleanup
92
- + deinit { unsub1(); unsub2(); unsub3() }
90
+ > **There is NO `joinSession` and NO `CallSession`.** The lifecycle is `generateToken` → `startSession` → `endSession`, all static on `CometChatCalls`.
91
+
92
+ ```swift
93
+ // `view` is the UIView the SDK renders the call into.
94
+ CometChatCalls.startSession(callToken: token, callSetting: callSettings, view: callView, onSuccess: { _ in
95
+ // session started
96
+ }, onError: { error in
97
+ // surface error
98
+ })
99
+
100
+ // End the call:
101
+ CometChatCalls.endSession() // EXISTS in v5 do not say it doesn't
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Step 6 — Events: `CallsEventsDelegate`, not `CometChatCallsEventsListener`
107
+
108
+ > **The listener protocol is `CallsEventsDelegate`.** `CometChatCallsEventsListener` does not exist. There is no `addEventListener(.someEnum)` granular-subscription API.
109
+
110
+ ```swift
111
+ // v5: implement the CallsEventsDelegate protocol (callbacks are @objc optional).
112
+ // Prefer the TYPED forms below (swiftinterface:29-54); the NSDictionary/NSArray
113
+ // overloads still exist but are DEPRECATED.
114
+ extension MyCallController: CallsEventsDelegate {
115
+ func onSessionTimeout() { /* idle timeout — swiftinterface:30 */ }
116
+ func onCallEnded() { /* ... */ }
117
+ func onCallEndButtonPressed() { /* ... */ }
118
+ func onUserJoined(rtcUser: RTCUser) { /* swiftinterface:35 */ }
119
+ func onUserLeft(rtcUser: RTCUser) { /* swiftinterface:38 */ }
120
+ func onUserListChanged(rtcUsers: [RTCUser]) { /* swiftinterface:41 */ }
121
+ func onAudioModeChanged(mode: [CallAudioMode]) { /* swiftinterface:44 */ }
122
+ func onCallSwitchedToVideo(callSwitchedInfo: CallSwitchRequestInfo) { /* swiftinterface:47 */ }
123
+ func onUserMuted(rtcMutedUser: RTCMutedUser) { /* swiftinterface:50 */ }
124
+ func onRecordingToggled(recordingInfo: RTCRecordingInfo) { /* one callback — no Started/Stopped/Failed split — swiftinterface:53 */ }
125
+ }
126
+
127
+ // Register either via the builder (setDelegate, Step 4) or:
128
+ CometChatCalls.addCallEventListener(observerId: "my-id", delegate: self)
93
129
  ```
94
130
 
131
+ There is no `onScreenShareStarted`/`onScreenShareEnded`, no `onChatButtonClicked`, no `onActiveSpeakerUpdated`, and no layout-change callback in v5.
132
+
95
133
  ---
96
134
 
97
- ## Step 6Method renames
135
+ ## Step 7In-call control method names
98
136
 
99
137
  ```diff
100
- // session lifecycle — receiver changed from CometChatCalls (static) to CallSession.shared (singleton)
101
- - CometChatCalls.endSession()
102
- + CallSession.shared.leaveSession()
138
+ - CometChatCalls.muteAudio(true) // phantom
139
+ + CometChatCalls.audioMuted(true) // mute
140
+ + CometChatCalls.audioMuted(false) // unmute
141
+
142
+ - CometChatCalls.pauseVideo(true) // phantom
143
+ + CometChatCalls.videoPaused(true)
144
+ + CometChatCalls.videoPaused(false)
145
+
146
+ CometChatCalls.switchCamera() // unchanged
147
+
148
+ - CometChatCalls.setMode(mode) // setMode is on CallSettingsBuilder, not the runtime facade
149
+ + // layout is fixed at session start via CallSettingsBuilder.setMode(_:) — there is no runtime setLayout
103
150
 
104
- - CometChatCalls.muteAudio(true)
105
- + CallSession.shared.muteAudio()
106
- - CometChatCalls.muteAudio(false)
107
- + CallSession.shared.unmuteAudio()
151
+ CometChatCalls.startRecording() // recording control
152
+ CometChatCalls.stopRecording()
153
+
154
+ CometChatCalls.enterPIPMode() // PiP — NOT CallSession.shared.enablePictureInPictureLayout
155
+ CometChatCalls.exitPIPMode()
156
+ ```
157
+
158
+ Local screen-share initiation is **not** available on the iOS Calls SDK v5 — there is no `startScreenShare`.
159
+
160
+ ---
161
+
162
+ ## Chat SDK signaling (ringing mode) — verify these too
163
+
164
+ ```diff
165
+ - Call(receiverUid: uid, receiverType: .user, callType: .video)
166
+ + Call(receiverId: uid, callType: .video, receiverType: .user) // CometChatSDK arg order
108
167
 
109
- - CometChatCalls.startScreenShare()
110
- + CallSession.shared.startScreenShare()
168
+ - callType: .voice
169
+ + callType: .audio // CallType is .audio / .video / .audioVideo — there is no .voice
111
170
 
112
- // layout stays static on CometChatCalls
113
- - CometChatCalls.setMode(mode)
114
- + CometChatCalls.setLayout(layout)
171
+ - CometChat.login(UID:..., authKey:...) // still correct; there is NO loginAsync
115
172
  ```
116
173
 
117
- **Hold onto the `CallSession.shared` singleton** — most in-call APIs (mute, video, screen-share, layout-events, leave) live on it, not on `CometChatCalls`. Same shift the Android SDK did in v5; if you've been writing call code against v4's static-method-everything pattern, this is the biggest re-org.
174
+ Call delegate is `CometChatCallDelegate` with two-param callbacks, e.g. `onIncomingCallReceived(incomingCall:error:)`; register with `CometChat.addCallListener(_:_:)` (positional labels).
118
175
 
119
176
  ---
120
177
 
121
178
  ## Verification checklist
122
179
 
123
- - [ ] Podfile / Package.swift updated
180
+ - [ ] Podfile / Package.swift updated to `~> 5.0`
124
181
  - [ ] `pod install --repo-update` (CocoaPods) or SwiftPM resolved cleanly
125
- - [ ] `CometChatCalls.login(authToken:)` called after `CometChat.login`
126
- - [ ] CallSettings.Builder replaced with `SessionSettings` struct
127
- - [ ] CometChatCallsEventsListener replaced with `addEventListener`
128
- - [ ] Method renames applied
129
- - [ ] PushKit + CallKit integration still works (no v5 changes there)
182
+ - [ ] NO `CometChatCalls.login` anywhere auth is per-session via `generateToken`
183
+ - [ ] `CallSettingsBuilder().build()` used; no `SessionSettings`/`SessionSettingsBuilder`
184
+ - [ ] `CallsEventsDelegate` implemented; no `CometChatCallsEventsListener`, no `addEventListener(.enum)`
185
+ - [ ] Lifecycle is `generateToken` → `startSession` → `endSession`; no `joinSession`, no `CallSession.shared`
186
+ - [ ] Controls use `audioMuted`/`videoPaused`/`enterPIPMode`/`exitPIPMode`
187
+ - [ ] `Call(receiverId:callType:receiverType:)` arg order; `CallType` has no `.voice`
130
188
  - [ ] Real-device smoke: incoming call from iPhone → answer → mute → end
131
189
 
132
190
  ---