@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.
Files changed (257) hide show
  1. package/bin/install.js +298 -41
  2. package/package.json +1 -1
  3. package/skills/cometchat/SKILL.md +146 -27
  4. package/skills/cometchat-a11y/SKILL.md +476 -0
  5. package/skills/cometchat-android-v5/SKILL.md +1 -1
  6. package/skills/cometchat-android-v5-calls/SKILL.md +413 -0
  7. package/skills/cometchat-android-v5-calls/references/README.md +53 -0
  8. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +195 -0
  9. package/skills/cometchat-android-v5-calls/references/audio-controls.md +91 -0
  10. package/skills/cometchat-android-v5-calls/references/background-handling.md +168 -0
  11. package/skills/cometchat-android-v5-calls/references/call-layouts.md +123 -0
  12. package/skills/cometchat-android-v5-calls/references/call-logs.md +113 -0
  13. package/skills/cometchat-android-v5-calls/references/call-session.md +274 -0
  14. package/skills/cometchat-android-v5-calls/references/custom-ui.md +150 -0
  15. package/skills/cometchat-android-v5-calls/references/event-listeners.md +123 -0
  16. package/skills/cometchat-android-v5-calls/references/group-calls.md +205 -0
  17. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +111 -0
  18. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +134 -0
  19. package/skills/cometchat-android-v5-calls/references/join-session.md +120 -0
  20. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +206 -0
  21. package/skills/cometchat-android-v5-calls/references/participant-management.md +110 -0
  22. package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +106 -0
  23. package/skills/cometchat-android-v5-calls/references/raise-hand.md +242 -0
  24. package/skills/cometchat-android-v5-calls/references/recording.md +101 -0
  25. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +152 -0
  26. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +82 -0
  27. package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +215 -0
  28. package/skills/cometchat-android-v5-calls/references/session-settings.md +121 -0
  29. package/skills/cometchat-android-v5-calls/references/setup.md +137 -0
  30. package/skills/cometchat-android-v5-calls/references/share-invite.md +151 -0
  31. package/skills/cometchat-android-v5-calls/references/video-controls.md +87 -0
  32. package/skills/cometchat-android-v5-calls/references/voip-calling.md +526 -0
  33. package/skills/cometchat-android-v5-components/SKILL.md +1 -1
  34. package/skills/cometchat-android-v5-core/SKILL.md +1 -1
  35. package/skills/cometchat-android-v5-customization/SKILL.md +1 -1
  36. package/skills/cometchat-android-v5-extensions/SKILL.md +1 -1
  37. package/skills/cometchat-android-v5-features/SKILL.md +1 -1
  38. package/skills/cometchat-android-v5-placement/SKILL.md +1 -1
  39. package/skills/cometchat-android-v5-production/SKILL.md +1 -1
  40. package/skills/cometchat-android-v5-push/SKILL.md +1 -1
  41. package/skills/cometchat-android-v5-testing/SKILL.md +1 -1
  42. package/skills/cometchat-android-v5-theming/SKILL.md +1 -1
  43. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +1 -1
  44. package/skills/cometchat-android-v6/SKILL.md +1 -1
  45. package/skills/cometchat-android-v6-builder-settings/SKILL.md +1 -1
  46. package/skills/cometchat-android-v6-calls/SKILL.md +375 -0
  47. package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +97 -0
  48. package/skills/cometchat-android-v6-calls/references/call-layouts.md +91 -0
  49. package/skills/cometchat-android-v6-calls/references/call-session.md +163 -0
  50. package/skills/cometchat-android-v6-calls/references/device-management.md +171 -0
  51. package/skills/cometchat-android-v6-calls/references/group-calls.md +191 -0
  52. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +107 -0
  53. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +136 -0
  54. package/skills/cometchat-android-v6-calls/references/raise-hand.md +186 -0
  55. package/skills/cometchat-android-v6-calls/references/ringing-integration.md +176 -0
  56. package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +127 -0
  57. package/skills/cometchat-android-v6-calls/references/share-invite.md +105 -0
  58. package/skills/cometchat-android-v6-compose-components/SKILL.md +2 -2
  59. package/skills/cometchat-android-v6-compose-customization/SKILL.md +1 -1
  60. package/skills/cometchat-android-v6-compose-placement/SKILL.md +1 -1
  61. package/skills/cometchat-android-v6-compose-theming/SKILL.md +1 -1
  62. package/skills/cometchat-android-v6-core/SKILL.md +1 -1
  63. package/skills/cometchat-android-v6-events/SKILL.md +1 -1
  64. package/skills/cometchat-android-v6-extensions/SKILL.md +1 -1
  65. package/skills/cometchat-android-v6-features/SKILL.md +1 -1
  66. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +1 -1
  67. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +1 -1
  68. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +1 -1
  69. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +1 -1
  70. package/skills/cometchat-android-v6-migration/SKILL.md +398 -0
  71. package/skills/cometchat-android-v6-production/SKILL.md +1 -1
  72. package/skills/cometchat-android-v6-push/SKILL.md +1 -1
  73. package/skills/cometchat-android-v6-testing/SKILL.md +1 -1
  74. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +1 -1
  75. package/skills/cometchat-angular-calls/SKILL.md +511 -0
  76. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +95 -0
  77. package/skills/cometchat-angular-calls/references/call-layouts.md +106 -0
  78. package/skills/cometchat-angular-calls/references/call-session.md +167 -0
  79. package/skills/cometchat-angular-calls/references/custom-ui.md +231 -0
  80. package/skills/cometchat-angular-calls/references/device-management.md +135 -0
  81. package/skills/cometchat-angular-calls/references/group-calls.md +412 -0
  82. package/skills/cometchat-angular-calls/references/idle-timeout.md +145 -0
  83. package/skills/cometchat-angular-calls/references/in-call-chat.md +148 -0
  84. package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +205 -0
  85. package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +53 -0
  86. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +183 -0
  87. package/skills/cometchat-angular-calls/references/picture-in-picture.md +285 -0
  88. package/skills/cometchat-angular-calls/references/raise-hand.md +167 -0
  89. package/skills/cometchat-angular-calls/references/recording-screen-share.md +267 -0
  90. package/skills/cometchat-angular-calls/references/ringing-integration.md +131 -0
  91. package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +100 -0
  92. package/skills/cometchat-angular-calls/references/share-invite.md +116 -0
  93. package/skills/cometchat-angular-components/SKILL.md +1 -1
  94. package/skills/cometchat-angular-core/SKILL.md +1 -1
  95. package/skills/cometchat-angular-customization/SKILL.md +1 -1
  96. package/skills/cometchat-angular-features/SKILL.md +1 -1
  97. package/skills/cometchat-angular-patterns/SKILL.md +1 -1
  98. package/skills/cometchat-angular-placement/SKILL.md +1 -1
  99. package/skills/cometchat-angular-production/SKILL.md +1 -1
  100. package/skills/cometchat-angular-push/SKILL.md +403 -0
  101. package/skills/cometchat-angular-testing/SKILL.md +333 -0
  102. package/skills/cometchat-angular-theming/SKILL.md +1 -1
  103. package/skills/cometchat-angular-troubleshooting/SKILL.md +1 -1
  104. package/skills/cometchat-astro-patterns/SKILL.md +1 -1
  105. package/skills/cometchat-calls/SKILL.md +358 -0
  106. package/skills/cometchat-calls/references/use-case-broadcast.md +194 -0
  107. package/skills/cometchat-calls/references/use-case-marketplace.md +158 -0
  108. package/skills/cometchat-calls/references/use-case-support.md +190 -0
  109. package/skills/cometchat-calls/references/use-case-team.md +169 -0
  110. package/skills/cometchat-calls/references/use-case-telehealth.md +154 -0
  111. package/skills/cometchat-components/SKILL.md +1 -1
  112. package/skills/cometchat-core/SKILL.md +1 -1
  113. package/skills/cometchat-customization/SKILL.md +2 -2
  114. package/skills/cometchat-features/SKILL.md +2 -2
  115. package/skills/cometchat-flutter-v5/SKILL.md +1 -1
  116. package/skills/cometchat-flutter-v5-calls/SKILL.md +325 -94
  117. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +169 -0
  118. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +98 -0
  119. package/skills/cometchat-flutter-v5-calls/references/call-session.md +330 -0
  120. package/skills/cometchat-flutter-v5-calls/references/device-management.md +120 -0
  121. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +187 -0
  122. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +97 -0
  123. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +132 -0
  124. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +160 -0
  125. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +244 -0
  126. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +193 -0
  127. package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +101 -0
  128. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +142 -0
  129. package/skills/cometchat-flutter-v5-conversations/SKILL.md +1 -1
  130. package/skills/cometchat-flutter-v5-core/SKILL.md +1 -1
  131. package/skills/cometchat-flutter-v5-customization/SKILL.md +1 -1
  132. package/skills/cometchat-flutter-v5-events/SKILL.md +1 -1
  133. package/skills/cometchat-flutter-v5-messages/SKILL.md +1 -1
  134. package/skills/cometchat-flutter-v5-production/SKILL.md +1 -1
  135. package/skills/cometchat-flutter-v5-push/SKILL.md +1 -1
  136. package/skills/cometchat-flutter-v5-testing/SKILL.md +390 -0
  137. package/skills/cometchat-flutter-v5-theming/SKILL.md +1 -1
  138. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +1 -1
  139. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +1 -1
  140. package/skills/cometchat-flutter-v6/SKILL.md +1 -1
  141. package/skills/cometchat-flutter-v6-calls/SKILL.md +308 -243
  142. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +134 -0
  143. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +102 -0
  144. package/skills/cometchat-flutter-v6-calls/references/call-session.md +229 -0
  145. package/skills/cometchat-flutter-v6-calls/references/device-management.md +99 -0
  146. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +190 -0
  147. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +80 -0
  148. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +122 -0
  149. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +268 -0
  150. package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +171 -0
  151. package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +93 -0
  152. package/skills/cometchat-flutter-v6-calls/references/share-invite.md +102 -0
  153. package/skills/cometchat-flutter-v6-components/SKILL.md +1 -1
  154. package/skills/cometchat-flutter-v6-conversations/SKILL.md +1 -1
  155. package/skills/cometchat-flutter-v6-core/SKILL.md +1 -1
  156. package/skills/cometchat-flutter-v6-customization/SKILL.md +1 -1
  157. package/skills/cometchat-flutter-v6-events/SKILL.md +1 -1
  158. package/skills/cometchat-flutter-v6-features/SKILL.md +1 -1
  159. package/skills/cometchat-flutter-v6-messages/SKILL.md +1 -1
  160. package/skills/cometchat-flutter-v6-migration/SKILL.md +1 -1
  161. package/skills/cometchat-flutter-v6-placement/SKILL.md +1 -1
  162. package/skills/cometchat-flutter-v6-production/SKILL.md +1 -1
  163. package/skills/cometchat-flutter-v6-push/SKILL.md +452 -0
  164. package/skills/cometchat-flutter-v6-testing/SKILL.md +319 -0
  165. package/skills/cometchat-flutter-v6-theming/SKILL.md +1 -1
  166. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +1 -1
  167. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +1 -1
  168. package/skills/cometchat-i18n/SKILL.md +358 -0
  169. package/skills/cometchat-ios/SKILL.md +5 -5
  170. package/skills/cometchat-ios-calls/SKILL.md +409 -0
  171. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +172 -0
  172. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +189 -0
  173. package/skills/cometchat-ios-calls/references/call-layouts.md +136 -0
  174. package/skills/cometchat-ios-calls/references/call-session.md +221 -0
  175. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +353 -0
  176. package/skills/cometchat-ios-calls/references/custom-ui.md +322 -0
  177. package/skills/cometchat-ios-calls/references/device-management.md +171 -0
  178. package/skills/cometchat-ios-calls/references/group-calls.md +396 -0
  179. package/skills/cometchat-ios-calls/references/idle-timeout.md +185 -0
  180. package/skills/cometchat-ios-calls/references/in-call-chat.md +183 -0
  181. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +138 -0
  182. package/skills/cometchat-ios-calls/references/picture-in-picture.md +246 -0
  183. package/skills/cometchat-ios-calls/references/raise-hand.md +239 -0
  184. package/skills/cometchat-ios-calls/references/recording-screen-share.md +339 -0
  185. package/skills/cometchat-ios-calls/references/ringing-integration.md +142 -0
  186. package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +267 -0
  187. package/skills/cometchat-ios-calls/references/share-invite.md +152 -0
  188. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +246 -0
  189. package/skills/cometchat-ios-calls/references/voip-cert-setup.md +166 -0
  190. package/skills/cometchat-ios-components/SKILL.md +1 -1
  191. package/skills/cometchat-ios-core/SKILL.md +1 -1
  192. package/skills/cometchat-ios-customization/SKILL.md +1 -1
  193. package/skills/cometchat-ios-features/SKILL.md +1 -1
  194. package/skills/cometchat-ios-placement/SKILL.md +1 -1
  195. package/skills/cometchat-ios-production/SKILL.md +1 -1
  196. package/skills/cometchat-ios-push/SKILL.md +1 -1
  197. package/skills/cometchat-ios-testing/SKILL.md +371 -0
  198. package/skills/cometchat-ios-theming/SKILL.md +1 -1
  199. package/skills/cometchat-ios-troubleshooting/SKILL.md +1 -1
  200. package/skills/cometchat-native-bare-patterns/SKILL.md +45 -3
  201. package/skills/cometchat-native-calls/SKILL.md +599 -0
  202. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +203 -0
  203. package/skills/cometchat-native-calls/references/call-layouts.md +124 -0
  204. package/skills/cometchat-native-calls/references/call-session.md +182 -0
  205. package/skills/cometchat-native-calls/references/custom-ui.md +250 -0
  206. package/skills/cometchat-native-calls/references/device-management.md +135 -0
  207. package/skills/cometchat-native-calls/references/expo-vs-bare.md +179 -0
  208. package/skills/cometchat-native-calls/references/group-calls.md +291 -0
  209. package/skills/cometchat-native-calls/references/idle-timeout.md +128 -0
  210. package/skills/cometchat-native-calls/references/in-call-chat.md +143 -0
  211. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +72 -0
  212. package/skills/cometchat-native-calls/references/picture-in-picture.md +276 -0
  213. package/skills/cometchat-native-calls/references/raise-hand.md +203 -0
  214. package/skills/cometchat-native-calls/references/recording-screen-share.md +290 -0
  215. package/skills/cometchat-native-calls/references/ringing-integration.md +118 -0
  216. package/skills/cometchat-native-calls/references/server-push-bridge.md +135 -0
  217. package/skills/cometchat-native-calls/references/server-push-payloads.md +193 -0
  218. package/skills/cometchat-native-calls/references/share-invite.md +144 -0
  219. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +317 -0
  220. package/skills/cometchat-native-components/SKILL.md +1 -1
  221. package/skills/cometchat-native-core/SKILL.md +1 -1
  222. package/skills/cometchat-native-customization/SKILL.md +1 -1
  223. package/skills/cometchat-native-expo-patterns/SKILL.md +18 -1
  224. package/skills/cometchat-native-features/SKILL.md +1 -1
  225. package/skills/cometchat-native-placement/SKILL.md +1 -1
  226. package/skills/cometchat-native-production/SKILL.md +1 -1
  227. package/skills/cometchat-native-push/SKILL.md +1 -1
  228. package/skills/cometchat-native-testing/SKILL.md +1 -1
  229. package/skills/cometchat-native-theming/SKILL.md +1 -1
  230. package/skills/cometchat-native-troubleshooting/SKILL.md +1 -1
  231. package/skills/cometchat-nextjs-patterns/SKILL.md +1 -1
  232. package/skills/cometchat-placement/SKILL.md +1 -1
  233. package/skills/cometchat-production/SKILL.md +1 -1
  234. package/skills/cometchat-react-calls/SKILL.md +539 -0
  235. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +145 -0
  236. package/skills/cometchat-react-calls/references/call-layouts.md +161 -0
  237. package/skills/cometchat-react-calls/references/call-session.md +235 -0
  238. package/skills/cometchat-react-calls/references/custom-ui.md +201 -0
  239. package/skills/cometchat-react-calls/references/device-management.md +206 -0
  240. package/skills/cometchat-react-calls/references/group-calls.md +262 -0
  241. package/skills/cometchat-react-calls/references/idle-timeout.md +175 -0
  242. package/skills/cometchat-react-calls/references/in-call-chat.md +212 -0
  243. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +172 -0
  244. package/skills/cometchat-react-calls/references/picture-in-picture.md +245 -0
  245. package/skills/cometchat-react-calls/references/raise-hand.md +238 -0
  246. package/skills/cometchat-react-calls/references/recording-screen-share.md +143 -0
  247. package/skills/cometchat-react-calls/references/ringing-integration.md +255 -0
  248. package/skills/cometchat-react-calls/references/server-web-push-vapid.md +241 -0
  249. package/skills/cometchat-react-calls/references/share-invite.md +176 -0
  250. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +198 -0
  251. package/skills/cometchat-react-calls/references/voip-and-web-push.md +165 -0
  252. package/skills/cometchat-react-patterns/SKILL.md +1 -1
  253. package/skills/cometchat-react-push/SKILL.md +448 -0
  254. package/skills/cometchat-react-router-patterns/SKILL.md +1 -1
  255. package/skills/cometchat-react-testing/SKILL.md +404 -0
  256. package/skills/cometchat-theming/SKILL.md +3 -3
  257. package/skills/cometchat-troubleshooting/SKILL.md +2 -2
@@ -0,0 +1,171 @@
1
+ # Ringing — call signaling with custom UI (Flutter V6 / Bloc)
2
+
3
+ Same SDK shape; Bloc-driven state instead of GetX.
4
+
5
+ **Read first:**
6
+ - `cometchat-flutter-v5-calls/references/ringing-integration.md` — V5 sister (GetX patterns)
7
+ - `cometchat-react-calls/references/ringing-integration.md` — full architecture, hard rules
8
+
9
+ ---
10
+
11
+ ## Bloc
12
+
13
+ ```dart
14
+ class CallSignalingState extends Equatable {
15
+ final Call? incoming;
16
+ final Call? outgoing;
17
+ final String? activeSessionId;
18
+
19
+ const CallSignalingState({this.incoming, this.outgoing, this.activeSessionId});
20
+ CallSignalingState copyWith({Call? incoming, Call? outgoing, String? activeSessionId}) =>
21
+ CallSignalingState(
22
+ incoming: incoming ?? this.incoming,
23
+ outgoing: outgoing ?? this.outgoing,
24
+ activeSessionId: activeSessionId ?? this.activeSessionId,
25
+ );
26
+ CallSignalingState clear() => const CallSignalingState();
27
+ @override
28
+ List<Object?> get props => [incoming?.sessionId, outgoing?.sessionId, activeSessionId];
29
+ }
30
+
31
+ abstract class CallSignalingEvent {}
32
+ class _IncomingReceived extends CallSignalingEvent { final Call call; _IncomingReceived(this.call); }
33
+ class _OutgoingAccepted extends CallSignalingEvent { final Call call; _OutgoingAccepted(this.call); }
34
+ class _OutgoingRejected extends CallSignalingEvent {}
35
+ class _IncomingCancelled extends CallSignalingEvent {}
36
+ class _CallEnded extends CallSignalingEvent {}
37
+ class InitiateCall extends CallSignalingEvent { final String receiverUid; final String type; InitiateCall(this.receiverUid, {this.type = 'video'}); }
38
+ class AcceptCall extends CallSignalingEvent { final Call call; AcceptCall(this.call); }
39
+ class RejectCall extends CallSignalingEvent { final Call call; RejectCall(this.call); }
40
+
41
+ class CallSignalingBloc extends Bloc<CallSignalingEvent, CallSignalingState> implements CallListener {
42
+ static const _listenerId = 'app';
43
+
44
+ CallSignalingBloc() : super(const CallSignalingState()) {
45
+ on<_IncomingReceived>((e, emit) => emit(state.copyWith(incoming: e.call)));
46
+ on<_OutgoingAccepted>((e, emit) => emit(state.copyWith(outgoing: null, activeSessionId: e.call.sessionId)));
47
+ on<_OutgoingRejected>((_, emit) => emit(state.copyWith(outgoing: null)));
48
+ on<_IncomingCancelled>((_, emit) => emit(state.copyWith(incoming: null)));
49
+ on<_CallEnded>((_, emit) => emit(state.clear()));
50
+ on<InitiateCall>(_onInitiate);
51
+ on<AcceptCall>(_onAccept);
52
+ on<RejectCall>(_onReject);
53
+
54
+ CometChat.addCallListener(_listenerId, this);
55
+ }
56
+
57
+ @override
58
+ void onIncomingCallReceived(Call call) => add(_IncomingReceived(call));
59
+ @override
60
+ void onOutgoingCallAccepted(Call call) => add(_OutgoingAccepted(call));
61
+ @override
62
+ void onOutgoingCallRejected(Call call) => add(_OutgoingRejected());
63
+ @override
64
+ void onIncomingCallCancelled(Call call) => add(_IncomingCancelled());
65
+ @override
66
+ void onCallEndedMessageReceived(Call call) => add(_CallEnded());
67
+
68
+ Future<void> _onInitiate(InitiateCall e, Emitter<CallSignalingState> emit) async {
69
+ final call = Call(
70
+ receiverUid: e.receiverUid,
71
+ callType: e.type == 'video' ? CometChatCallType.video : CometChatCallType.audio,
72
+ receiverType: CometChatReceiverType.user,
73
+ );
74
+ final result = await CometChat.initiateCall(call: call);
75
+ if (result is Call) emit(state.copyWith(outgoing: result));
76
+ }
77
+
78
+ Future<void> _onAccept(AcceptCall e, Emitter<CallSignalingState> emit) async {
79
+ final result = await CometChat.acceptCall(sessionId: e.call.sessionId!);
80
+ if (result is Call) emit(state.copyWith(incoming: null, activeSessionId: result.sessionId));
81
+ }
82
+
83
+ Future<void> _onReject(RejectCall e, Emitter<CallSignalingState> emit) async {
84
+ await CometChat.rejectCall(sessionId: e.call.sessionId!, status: CallStatus.rejected);
85
+ emit(state.copyWith(incoming: null));
86
+ }
87
+
88
+ @override
89
+ Future<void> close() {
90
+ CometChat.removeCallListener(_listenerId);
91
+ return super.close();
92
+ }
93
+ }
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Provide above the router
99
+
100
+ ```dart
101
+ BlocProvider<CallSignalingBloc>(
102
+ create: (_) => CallSignalingBloc(),
103
+ child: MaterialApp.router(...),
104
+ );
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Incoming-call overlay
110
+
111
+ ```dart
112
+ class IncomingCallOverlay extends StatelessWidget {
113
+ const IncomingCallOverlay({super.key});
114
+
115
+ @override
116
+ Widget build(BuildContext context) {
117
+ return BlocBuilder<CallSignalingBloc, CallSignalingState>(
118
+ buildWhen: (prev, curr) => prev.incoming?.sessionId != curr.incoming?.sessionId,
119
+ builder: (context, state) {
120
+ final call = state.incoming;
121
+ if (call == null) return const SizedBox.shrink();
122
+ // Same UI as V5 sister; replace ctrl.accept/reject with bloc.add(...)
123
+ return Material(/* ... see V5 sister ... */);
124
+ },
125
+ );
126
+ }
127
+ }
128
+ ```
129
+
130
+ Mount in `MaterialApp.builder`:
131
+
132
+ ```dart
133
+ MaterialApp.router(
134
+ builder: (context, child) => Stack(
135
+ children: [
136
+ child ?? const SizedBox.shrink(),
137
+ const IncomingCallOverlay(),
138
+ ],
139
+ ),
140
+ routerConfig: ...,
141
+ );
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Anti-patterns
147
+
148
+ V5 sister rules apply, plus V6-specific:
149
+
150
+ 1. **`BlocBuilder` without `buildWhen`.** Rebuilds on every state change — listener events for outgoing/active also retrigger incoming UI.
151
+ 2. **Calling SDK methods from UI directly.** Adds back to bloc — use `bloc.add(InitiateCall(...))`.
152
+ 3. **Provider scoped to a feature module.** Backgrounded ring path can't find the bloc when push fires.
153
+
154
+ ---
155
+
156
+ ## Verification checklist
157
+
158
+ - [ ] `BlocProvider<CallSignalingBloc>` above `MaterialApp`
159
+ - [ ] `IncomingCallOverlay` in `MaterialApp.builder`'s Stack
160
+ - [ ] `BlocBuilder` uses `buildWhen` to scope rebuilds to `incoming` changes
161
+ - [ ] `close()` calls `removeCallListener`
162
+ - [ ] Real-device smoke: same as V5 sister
163
+
164
+ ---
165
+
166
+ ## Pointers
167
+
168
+ - `cometchat-flutter-v5-calls/references/ringing-integration.md` — V5 sister (GetX)
169
+ - `cometchat-flutter-v6-calls/SKILL.md` — V6 Bloc patterns
170
+ - `cometchat-flutter-v6-calls/references/server-push-bridge.md` — backgrounded ring
171
+ - Canonical docs: https://www.cometchat.com/docs/calls/flutter/ringing
@@ -0,0 +1,93 @@
1
+ # Server-side push routing for Flutter V6 (iOS PushKit + Android FCM)
2
+
3
+ V6 uses the same server templates and platform plugins as V5. The only V6-specific delta is wrapping token registration in a Bloc.
4
+
5
+ **Canonical docs:**
6
+ - iOS: `cometchat-ios-calls/references/server-apns-pushkit.md`
7
+ - Android: `cometchat-android-v5-calls/references/server-fcm-voip.md`
8
+ - Read first: `cometchat-flutter-v5-calls/references/server-push-bridge.md` — Flutter token registration patterns.
9
+
10
+ ---
11
+
12
+ ## Bloc-style token registration
13
+
14
+ ```dart
15
+ class CallPushBloc extends Bloc<CallPushEvent, CallPushState> {
16
+ CallPushBloc({required this.api}) : super(const CallPushState.idle()) {
17
+ on<RegisterTokens>(_onRegister);
18
+ }
19
+ final Api api;
20
+
21
+ Future<void> _onRegister(RegisterTokens event, Emitter<CallPushState> emit) async {
22
+ emit(const CallPushState.registering());
23
+ try {
24
+ if (Platform.isIOS) {
25
+ final voip = FlutterVoipPushKit();
26
+ voip.onTokenRefresh.listen((token) {
27
+ api.registerCallToken(uid: event.uid, platform: 'ios-voip', token: token);
28
+ });
29
+ await voip.configure();
30
+ } else if (Platform.isAndroid) {
31
+ final messaging = FirebaseMessaging.instance;
32
+ await messaging.requestPermission();
33
+ final token = await messaging.getToken();
34
+ if (token != null) {
35
+ await api.registerCallToken(uid: event.uid, platform: 'android-fcm', token: token);
36
+ }
37
+ messaging.onTokenRefresh.listen((t) {
38
+ api.registerCallToken(uid: event.uid, platform: 'android-fcm', token: t);
39
+ });
40
+ }
41
+ emit(const CallPushState.registered());
42
+ } catch (err) {
43
+ emit(CallPushState.failed(err.toString()));
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ Dispatch after login completes:
50
+
51
+ ```dart
52
+ BlocListener<AuthBloc, AuthState>(
53
+ listener: (context, state) {
54
+ if (state is Authenticated) {
55
+ context.read<CallPushBloc>().add(RegisterTokens(uid: state.uid));
56
+ }
57
+ },
58
+ child: const CallSurface(),
59
+ );
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Server-side: unchanged from V5
65
+
66
+ Identical to V5 — same APNs PushKit + FCM HTTP v1 templates.
67
+
68
+ ---
69
+
70
+ ## Anti-patterns
71
+
72
+ V5 sister rules apply, plus V6-specific:
73
+
74
+ 1. **Registering pushes in `main()` before MultiBlocProvider.** No bloc available; can't dispatch.
75
+ 2. **Adding `RegisterTokens` from `BlocBuilder`.** BlocBuilder is for UI rebuilds. Use `BlocListener` for one-shot side effects.
76
+
77
+ ---
78
+
79
+ ## Verification checklist
80
+
81
+ - [ ] `CallPushBloc` provided above the auth flow
82
+ - [ ] BlocListener triggers `RegisterTokens` post-login
83
+ - [ ] Server templates wired (see V5 sister)
84
+ - [ ] Real-device smoke: both iOS and Android ring
85
+
86
+ ---
87
+
88
+ ## Pointers
89
+
90
+ - `cometchat-flutter-v5-calls/references/server-push-bridge.md` — V5 sister (token registration patterns)
91
+ - `cometchat-ios-calls/references/server-apns-pushkit.md` — iOS canonical
92
+ - `cometchat-android-v5-calls/references/server-fcm-voip.md` — Android canonical
93
+ - `cometchat-flutter-v6-calls` SKILL.md
@@ -0,0 +1,102 @@
1
+ # Share invite on Flutter V6 (Bloc)
2
+
3
+ Same SDK + share_plus. V6-specific: wrap share state in a Cubit so the UI can disable the button while a share is in flight.
4
+
5
+ **Canonical docs:** https://www.cometchat.com/docs/calls/flutter/share-invite
6
+ **Read first:** `cometchat-flutter-v5-calls/references/share-invite.md` — share_plus + deep-link config.
7
+
8
+ ---
9
+
10
+ ## Cubit
11
+
12
+ ```dart
13
+ class ShareInviteCubit extends Cubit<bool> {
14
+ ShareInviteCubit() : super(false); // false = idle, true = sharing
15
+
16
+ Future<void> share(String sessionId, {Rect? origin}) async {
17
+ if (state) return; // debounce
18
+ emit(true);
19
+ try {
20
+ final url = 'https://yourapp.com/call/$sessionId';
21
+ await Share.share(
22
+ "I'm on a call — tap to join.\n$url",
23
+ subject: 'Join my call',
24
+ sharePositionOrigin: origin,
25
+ );
26
+ } finally {
27
+ emit(false);
28
+ }
29
+ }
30
+ }
31
+ ```
32
+
33
+ The boolean state is enough; we don't need a sealed-class state hierarchy here.
34
+
35
+ ---
36
+
37
+ ## Bridge from SDK event
38
+
39
+ ```dart
40
+ @override
41
+ void onShareInviteButtonClicked() {
42
+ context.read<ShareInviteCubit>().share(sessionId);
43
+ }
44
+ ```
45
+
46
+ ---
47
+
48
+ ## App-built share button
49
+
50
+ ```dart
51
+ class ShareInviteButton extends StatelessWidget {
52
+ final String sessionId;
53
+ const ShareInviteButton({super.key, required this.sessionId});
54
+
55
+ @override
56
+ Widget build(BuildContext context) {
57
+ return BlocBuilder<ShareInviteCubit, bool>(
58
+ builder: (context, sharing) => IconButton(
59
+ icon: sharing
60
+ ? const SizedBox(width: 24, height: 24, child: CircularProgressIndicator(strokeWidth: 2))
61
+ : const Icon(Icons.share),
62
+ onPressed: sharing
63
+ ? null
64
+ : () {
65
+ final box = context.findRenderObject() as RenderBox?;
66
+ context.read<ShareInviteCubit>().share(
67
+ sessionId,
68
+ origin: box != null ? box.localToGlobal(Offset.zero) & box.size : null,
69
+ );
70
+ },
71
+ ),
72
+ );
73
+ }
74
+ }
75
+ ```
76
+
77
+ ---
78
+
79
+ ## Anti-patterns
80
+
81
+ V5 sister rules apply, plus V6-specific:
82
+
83
+ 1. **Full Bloc with events for a 1-state-update flow.** Cubit fits cleanly.
84
+ 2. **Forgetting `try/finally` around `Share.share`.** If share throws, button stays in disabled state forever.
85
+
86
+ ---
87
+
88
+ ## Verification checklist
89
+
90
+ - [ ] `ShareInviteCubit` provided above call screen
91
+ - [ ] Button disabled while sharing (BlocBuilder)
92
+ - [ ] iPad anchor passed via `sharePositionOrigin`
93
+ - [ ] `try/finally` ensures cubit resets even on error
94
+ - [ ] Real-device smoke: same as V5
95
+
96
+ ---
97
+
98
+ ## Pointers
99
+
100
+ - `cometchat-flutter-v5-calls/references/share-invite.md` — V5 sister
101
+ - `cometchat-flutter-v6-calls` SKILL.md
102
+ - Canonical docs: https://www.cometchat.com/docs/calls/flutter/share-invite
@@ -8,7 +8,7 @@ description: >
8
8
  bubbles, list base, search, status indicator).
9
9
  license: "MIT"
10
10
  compatibility: "cometchat_chat_uikit ^6.0.0-beta2; flutter >=2.5.0"
11
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
11
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
12
12
  metadata:
13
13
  author: "CometChat"
14
14
  version: "3.0.0"
@@ -10,7 +10,7 @@ description: >
10
10
  Also use when the user asks about showing a list of chats or recent conversations.
11
11
  license: "MIT"
12
12
  compatibility: "cometchat_chat_uikit ^6.0.0-beta2; flutter_bloc ^8.1.0"
13
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
13
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
14
14
  metadata:
15
15
  author: "CometChat"
16
16
  version: "3.0.0"
@@ -11,7 +11,7 @@ description: >
11
11
  UIKit code, even simple widget usage.
12
12
  license: "MIT"
13
13
  compatibility: "cometchat_chat_uikit ^6.0.0-beta2; flutter_bloc ^8.1.0"
14
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
14
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
15
15
  metadata:
16
16
  author: "CometChat"
17
17
  version: "3.0.0"
@@ -7,7 +7,7 @@ description: >
7
7
  message actions, or custom message types.
8
8
  license: "MIT"
9
9
  compatibility: "cometchat_chat_uikit ^6.0.0-beta2"
10
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
10
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
11
11
  metadata:
12
12
  author: "CometChat"
13
13
  version: "3.0.0"
@@ -13,7 +13,7 @@ description: >
13
13
  or any real-time update handling in CometChat.
14
14
  license: "MIT"
15
15
  compatibility: "cometchat_chat_uikit ^6.0.0-beta2; cometchat_sdk ^4.1.2"
16
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
16
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
17
17
  metadata:
18
18
  author: "CometChat"
19
19
  version: "3.0.0"
@@ -8,7 +8,7 @@ description: >
8
8
  and what needs manual dashboard configuration (third-party API keys).
9
9
  license: "MIT"
10
10
  compatibility: "cometchat_chat_uikit ^6.0.0-beta2"
11
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
11
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
12
12
  metadata:
13
13
  author: "CometChat"
14
14
  version: "3.0.0"
@@ -13,7 +13,7 @@ description: >
13
13
  the user asks about building a chat screen, message input, or message display.
14
14
  license: "MIT"
15
15
  compatibility: "cometchat_chat_uikit ^6.0.0-beta2; flutter_bloc ^8.1.0"
16
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
16
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
17
17
  metadata:
18
18
  author: "CometChat"
19
19
  version: "3.0.0"
@@ -9,7 +9,7 @@ description: >
9
9
  like GetBuilder, Get.put, Get.find, PageManager, BuilderSettings, or CometChatCallingExtension.
10
10
  license: "MIT"
11
11
  compatibility: "cometchat_chat_uikit 6.0.0-beta2"
12
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
12
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
13
13
  metadata:
14
14
  author: "CometChat"
15
15
  version: "3.0.0"
@@ -10,7 +10,7 @@ description: >
10
10
  "Scaffold layout", or "keyboard handling".
11
11
  license: "MIT"
12
12
  compatibility: "cometchat_chat_uikit ^6.0.0-beta2; flutter >=2.5.0"
13
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
13
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
14
14
  metadata:
15
15
  author: "CometChat"
16
16
  version: "3.0.0"
@@ -7,7 +7,7 @@ description: >
7
7
  a CometChat Flutter app for production deployment.
8
8
  license: "MIT"
9
9
  compatibility: "cometchat_chat_uikit ^6.0.0-beta2"
10
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
10
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
11
11
  metadata:
12
12
  author: "CometChat"
13
13
  version: "3.0.0"