@cometchat/skills 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/install.js +298 -41
- package/package.json +1 -1
- package/skills/cometchat/SKILL.md +146 -27
- package/skills/cometchat-a11y/SKILL.md +476 -0
- package/skills/cometchat-android-v5/SKILL.md +1 -1
- package/skills/cometchat-android-v5-calls/SKILL.md +413 -0
- package/skills/cometchat-android-v5-calls/references/README.md +53 -0
- package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +195 -0
- package/skills/cometchat-android-v5-calls/references/audio-controls.md +91 -0
- package/skills/cometchat-android-v5-calls/references/background-handling.md +168 -0
- package/skills/cometchat-android-v5-calls/references/call-layouts.md +123 -0
- package/skills/cometchat-android-v5-calls/references/call-logs.md +113 -0
- package/skills/cometchat-android-v5-calls/references/call-session.md +274 -0
- package/skills/cometchat-android-v5-calls/references/custom-ui.md +150 -0
- package/skills/cometchat-android-v5-calls/references/event-listeners.md +123 -0
- package/skills/cometchat-android-v5-calls/references/group-calls.md +205 -0
- package/skills/cometchat-android-v5-calls/references/idle-timeout.md +111 -0
- package/skills/cometchat-android-v5-calls/references/in-call-chat.md +134 -0
- package/skills/cometchat-android-v5-calls/references/join-session.md +120 -0
- package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +206 -0
- package/skills/cometchat-android-v5-calls/references/participant-management.md +110 -0
- package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +106 -0
- package/skills/cometchat-android-v5-calls/references/raise-hand.md +242 -0
- package/skills/cometchat-android-v5-calls/references/recording.md +101 -0
- package/skills/cometchat-android-v5-calls/references/ringing-integration.md +152 -0
- package/skills/cometchat-android-v5-calls/references/screen-sharing.md +82 -0
- package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +215 -0
- package/skills/cometchat-android-v5-calls/references/session-settings.md +121 -0
- package/skills/cometchat-android-v5-calls/references/setup.md +137 -0
- package/skills/cometchat-android-v5-calls/references/share-invite.md +151 -0
- package/skills/cometchat-android-v5-calls/references/video-controls.md +87 -0
- package/skills/cometchat-android-v5-calls/references/voip-calling.md +526 -0
- package/skills/cometchat-android-v5-components/SKILL.md +1 -1
- package/skills/cometchat-android-v5-core/SKILL.md +1 -1
- package/skills/cometchat-android-v5-customization/SKILL.md +1 -1
- package/skills/cometchat-android-v5-extensions/SKILL.md +1 -1
- package/skills/cometchat-android-v5-features/SKILL.md +1 -1
- package/skills/cometchat-android-v5-placement/SKILL.md +1 -1
- package/skills/cometchat-android-v5-production/SKILL.md +1 -1
- package/skills/cometchat-android-v5-push/SKILL.md +1 -1
- package/skills/cometchat-android-v5-testing/SKILL.md +1 -1
- package/skills/cometchat-android-v5-theming/SKILL.md +1 -1
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-android-v6/SKILL.md +1 -1
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +1 -1
- package/skills/cometchat-android-v6-calls/SKILL.md +375 -0
- package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +97 -0
- package/skills/cometchat-android-v6-calls/references/call-layouts.md +91 -0
- package/skills/cometchat-android-v6-calls/references/call-session.md +163 -0
- package/skills/cometchat-android-v6-calls/references/device-management.md +171 -0
- package/skills/cometchat-android-v6-calls/references/group-calls.md +191 -0
- package/skills/cometchat-android-v6-calls/references/idle-timeout.md +107 -0
- package/skills/cometchat-android-v6-calls/references/in-call-chat.md +136 -0
- package/skills/cometchat-android-v6-calls/references/raise-hand.md +186 -0
- package/skills/cometchat-android-v6-calls/references/ringing-integration.md +176 -0
- package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +127 -0
- package/skills/cometchat-android-v6-calls/references/share-invite.md +105 -0
- package/skills/cometchat-android-v6-compose-components/SKILL.md +2 -2
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +1 -1
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +1 -1
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +1 -1
- package/skills/cometchat-android-v6-core/SKILL.md +1 -1
- package/skills/cometchat-android-v6-events/SKILL.md +1 -1
- package/skills/cometchat-android-v6-extensions/SKILL.md +1 -1
- package/skills/cometchat-android-v6-features/SKILL.md +1 -1
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +1 -1
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +1 -1
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +1 -1
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +1 -1
- package/skills/cometchat-android-v6-migration/SKILL.md +398 -0
- package/skills/cometchat-android-v6-production/SKILL.md +1 -1
- package/skills/cometchat-android-v6-push/SKILL.md +1 -1
- package/skills/cometchat-android-v6-testing/SKILL.md +1 -1
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-angular-calls/SKILL.md +511 -0
- package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +95 -0
- package/skills/cometchat-angular-calls/references/call-layouts.md +106 -0
- package/skills/cometchat-angular-calls/references/call-session.md +167 -0
- package/skills/cometchat-angular-calls/references/custom-ui.md +231 -0
- package/skills/cometchat-angular-calls/references/device-management.md +135 -0
- package/skills/cometchat-angular-calls/references/group-calls.md +412 -0
- package/skills/cometchat-angular-calls/references/idle-timeout.md +145 -0
- package/skills/cometchat-angular-calls/references/in-call-chat.md +148 -0
- package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +205 -0
- package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +53 -0
- package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +183 -0
- package/skills/cometchat-angular-calls/references/picture-in-picture.md +285 -0
- package/skills/cometchat-angular-calls/references/raise-hand.md +167 -0
- package/skills/cometchat-angular-calls/references/recording-screen-share.md +267 -0
- package/skills/cometchat-angular-calls/references/ringing-integration.md +131 -0
- package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +100 -0
- package/skills/cometchat-angular-calls/references/share-invite.md +116 -0
- package/skills/cometchat-angular-components/SKILL.md +1 -1
- package/skills/cometchat-angular-core/SKILL.md +1 -1
- package/skills/cometchat-angular-customization/SKILL.md +1 -1
- package/skills/cometchat-angular-features/SKILL.md +1 -1
- package/skills/cometchat-angular-patterns/SKILL.md +1 -1
- package/skills/cometchat-angular-placement/SKILL.md +1 -1
- package/skills/cometchat-angular-production/SKILL.md +1 -1
- package/skills/cometchat-angular-push/SKILL.md +403 -0
- package/skills/cometchat-angular-testing/SKILL.md +333 -0
- package/skills/cometchat-angular-theming/SKILL.md +1 -1
- package/skills/cometchat-angular-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-astro-patterns/SKILL.md +1 -1
- package/skills/cometchat-calls/SKILL.md +358 -0
- package/skills/cometchat-calls/references/use-case-broadcast.md +194 -0
- package/skills/cometchat-calls/references/use-case-marketplace.md +158 -0
- package/skills/cometchat-calls/references/use-case-support.md +190 -0
- package/skills/cometchat-calls/references/use-case-team.md +169 -0
- package/skills/cometchat-calls/references/use-case-telehealth.md +154 -0
- package/skills/cometchat-components/SKILL.md +1 -1
- package/skills/cometchat-core/SKILL.md +1 -1
- package/skills/cometchat-customization/SKILL.md +2 -2
- package/skills/cometchat-features/SKILL.md +2 -2
- package/skills/cometchat-flutter-v5/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-calls/SKILL.md +325 -94
- package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +169 -0
- package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +98 -0
- package/skills/cometchat-flutter-v5-calls/references/call-session.md +330 -0
- package/skills/cometchat-flutter-v5-calls/references/device-management.md +120 -0
- package/skills/cometchat-flutter-v5-calls/references/group-calls.md +187 -0
- package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +97 -0
- package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +132 -0
- package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +160 -0
- package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +244 -0
- package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +193 -0
- package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +101 -0
- package/skills/cometchat-flutter-v5-calls/references/share-invite.md +142 -0
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-core/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-customization/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-events/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-messages/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-production/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-push/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-testing/SKILL.md +390 -0
- package/skills/cometchat-flutter-v5-theming/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-calls/SKILL.md +308 -243
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +134 -0
- package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +102 -0
- package/skills/cometchat-flutter-v6-calls/references/call-session.md +229 -0
- package/skills/cometchat-flutter-v6-calls/references/device-management.md +99 -0
- package/skills/cometchat-flutter-v6-calls/references/group-calls.md +190 -0
- package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +80 -0
- package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +122 -0
- package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +268 -0
- package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +171 -0
- package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +93 -0
- package/skills/cometchat-flutter-v6-calls/references/share-invite.md +102 -0
- package/skills/cometchat-flutter-v6-components/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-core/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-customization/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-events/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-features/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-messages/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-migration/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-placement/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-production/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-push/SKILL.md +452 -0
- package/skills/cometchat-flutter-v6-testing/SKILL.md +319 -0
- package/skills/cometchat-flutter-v6-theming/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +1 -1
- package/skills/cometchat-i18n/SKILL.md +358 -0
- package/skills/cometchat-ios/SKILL.md +5 -5
- package/skills/cometchat-ios-calls/SKILL.md +409 -0
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +172 -0
- package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +189 -0
- package/skills/cometchat-ios-calls/references/call-layouts.md +136 -0
- package/skills/cometchat-ios-calls/references/call-session.md +221 -0
- package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +353 -0
- package/skills/cometchat-ios-calls/references/custom-ui.md +322 -0
- package/skills/cometchat-ios-calls/references/device-management.md +171 -0
- package/skills/cometchat-ios-calls/references/group-calls.md +396 -0
- package/skills/cometchat-ios-calls/references/idle-timeout.md +185 -0
- package/skills/cometchat-ios-calls/references/in-call-chat.md +183 -0
- package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +138 -0
- package/skills/cometchat-ios-calls/references/picture-in-picture.md +246 -0
- package/skills/cometchat-ios-calls/references/raise-hand.md +239 -0
- package/skills/cometchat-ios-calls/references/recording-screen-share.md +339 -0
- package/skills/cometchat-ios-calls/references/ringing-integration.md +142 -0
- package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +267 -0
- package/skills/cometchat-ios-calls/references/share-invite.md +152 -0
- package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +246 -0
- package/skills/cometchat-ios-calls/references/voip-cert-setup.md +166 -0
- package/skills/cometchat-ios-components/SKILL.md +1 -1
- package/skills/cometchat-ios-core/SKILL.md +1 -1
- package/skills/cometchat-ios-customization/SKILL.md +1 -1
- package/skills/cometchat-ios-features/SKILL.md +1 -1
- package/skills/cometchat-ios-placement/SKILL.md +1 -1
- package/skills/cometchat-ios-production/SKILL.md +1 -1
- package/skills/cometchat-ios-push/SKILL.md +1 -1
- package/skills/cometchat-ios-testing/SKILL.md +371 -0
- package/skills/cometchat-ios-theming/SKILL.md +1 -1
- package/skills/cometchat-ios-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-native-bare-patterns/SKILL.md +45 -3
- package/skills/cometchat-native-calls/SKILL.md +599 -0
- package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +203 -0
- package/skills/cometchat-native-calls/references/call-layouts.md +124 -0
- package/skills/cometchat-native-calls/references/call-session.md +182 -0
- package/skills/cometchat-native-calls/references/custom-ui.md +250 -0
- package/skills/cometchat-native-calls/references/device-management.md +135 -0
- package/skills/cometchat-native-calls/references/expo-vs-bare.md +179 -0
- package/skills/cometchat-native-calls/references/group-calls.md +291 -0
- package/skills/cometchat-native-calls/references/idle-timeout.md +128 -0
- package/skills/cometchat-native-calls/references/in-call-chat.md +143 -0
- package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +72 -0
- package/skills/cometchat-native-calls/references/picture-in-picture.md +276 -0
- package/skills/cometchat-native-calls/references/raise-hand.md +203 -0
- package/skills/cometchat-native-calls/references/recording-screen-share.md +290 -0
- package/skills/cometchat-native-calls/references/ringing-integration.md +118 -0
- package/skills/cometchat-native-calls/references/server-push-bridge.md +135 -0
- package/skills/cometchat-native-calls/references/server-push-payloads.md +193 -0
- package/skills/cometchat-native-calls/references/share-invite.md +144 -0
- package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +317 -0
- package/skills/cometchat-native-components/SKILL.md +1 -1
- package/skills/cometchat-native-core/SKILL.md +1 -1
- package/skills/cometchat-native-customization/SKILL.md +1 -1
- package/skills/cometchat-native-expo-patterns/SKILL.md +18 -1
- package/skills/cometchat-native-features/SKILL.md +1 -1
- package/skills/cometchat-native-placement/SKILL.md +1 -1
- package/skills/cometchat-native-production/SKILL.md +1 -1
- package/skills/cometchat-native-push/SKILL.md +1 -1
- package/skills/cometchat-native-testing/SKILL.md +1 -1
- package/skills/cometchat-native-theming/SKILL.md +1 -1
- package/skills/cometchat-native-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-nextjs-patterns/SKILL.md +1 -1
- package/skills/cometchat-placement/SKILL.md +1 -1
- package/skills/cometchat-production/SKILL.md +1 -1
- package/skills/cometchat-react-calls/SKILL.md +539 -0
- package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +145 -0
- package/skills/cometchat-react-calls/references/call-layouts.md +161 -0
- package/skills/cometchat-react-calls/references/call-session.md +235 -0
- package/skills/cometchat-react-calls/references/custom-ui.md +201 -0
- package/skills/cometchat-react-calls/references/device-management.md +206 -0
- package/skills/cometchat-react-calls/references/group-calls.md +262 -0
- package/skills/cometchat-react-calls/references/idle-timeout.md +175 -0
- package/skills/cometchat-react-calls/references/in-call-chat.md +212 -0
- package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +172 -0
- package/skills/cometchat-react-calls/references/picture-in-picture.md +245 -0
- package/skills/cometchat-react-calls/references/raise-hand.md +238 -0
- package/skills/cometchat-react-calls/references/recording-screen-share.md +143 -0
- package/skills/cometchat-react-calls/references/ringing-integration.md +255 -0
- package/skills/cometchat-react-calls/references/server-web-push-vapid.md +241 -0
- package/skills/cometchat-react-calls/references/share-invite.md +176 -0
- package/skills/cometchat-react-calls/references/testing-calls-on-web.md +198 -0
- package/skills/cometchat-react-calls/references/voip-and-web-push.md +165 -0
- package/skills/cometchat-react-patterns/SKILL.md +1 -1
- package/skills/cometchat-react-push/SKILL.md +448 -0
- package/skills/cometchat-react-router-patterns/SKILL.md +1 -1
- package/skills/cometchat-react-testing/SKILL.md +404 -0
- package/skills/cometchat-theming/SKILL.md +3 -3
- package/skills/cometchat-troubleshooting/SKILL.md +2 -2
|
@@ -0,0 +1,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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
10
|
+
allowed-tools: "shell, file-read, file-search, file-list, grep"
|
|
11
11
|
metadata:
|
|
12
12
|
author: "CometChat"
|
|
13
13
|
version: "3.0.0"
|