@cometchat/skills 4.4.1 → 5.0.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/.claude-plugin/marketplace.json +55 -0
- package/.claude-plugin/plugin.json +14 -0
- package/CHANGELOG.md +36 -0
- package/README.md +41 -163
- package/RULES.md +114 -0
- package/bin/cometchat-skills.mjs +1180 -0
- package/bin/legacy-skills.json +95 -0
- package/catalogs/android-v6.json +1646 -0
- package/catalogs/flutter-v6.json +651 -0
- package/catalogs/ios-v5.json +1383 -0
- package/catalogs/rn-calls-v5.json +134 -0
- package/catalogs/rn-calls-v5.symbols.txt +58 -0
- package/catalogs/rn-sdk-v4.json +672 -0
- package/catalogs/rn-v5.json +449 -0
- package/catalogs/rn-v5.symbols.txt +216 -0
- package/catalogs/sdk-android-v5.json +514 -0
- package/contracts.android-calls-v5.json +122 -0
- package/contracts.android-v6.json +135 -0
- package/contracts.angular-v5.json +694 -0
- package/contracts.flutter-calls-v5.json +77 -0
- package/contracts.flutter-v6.json +126 -0
- package/contracts.ios-calls-v5.json +67 -0
- package/contracts.ios-v5.json +436 -0
- package/contracts.json +82 -0
- package/contracts.rn-calls-v5.json +77 -0
- package/contracts.rn-v5.json +727 -0
- package/contracts.sdk-android-v5.json +15 -0
- package/contracts.web-calls-v5.json +45 -0
- package/features.android-calls-v5.json +246 -0
- package/features.android-v6.json +65 -0
- package/features.angular-v5.json +521 -0
- package/features.flutter-calls-v5.json +286 -0
- package/features.flutter-v6.json +484 -0
- package/features.ios-calls-v5.json +236 -0
- package/features.ios-v5.json +573 -0
- package/features.json +61 -0
- package/features.rn-calls-v5.json +187 -0
- package/features.rn-v5.json +614 -0
- package/features.sdk-android-v5.json +40 -0
- package/features.sdk-jsv4.json +24 -0
- package/features.web-calls-v5.json +108 -0
- package/package.json +151 -74
- package/peers.yaml +312 -0
- package/registry/README.md +31 -0
- package/registry/android-calls-v5.json +54 -0
- package/registry/android-v6.json +137 -0
- package/registry/angular-v5.json +114 -0
- package/registry/flutter-calls-v5.json +54 -0
- package/registry/flutter-v6.json +119 -0
- package/registry/ios-calls-v5.json +59 -0
- package/registry/ios-v5.json +97 -0
- package/registry/rn-calls-v5.json +59 -0
- package/registry/rn-v5.json +129 -0
- package/registry/sdk-android-v5.json +53 -0
- package/registry/sdk-jsv4.json +53 -0
- package/registry/web-calls-v5.json +54 -0
- package/registry/web-v7.json +99 -0
- package/skills/cometchat/SKILL.md +42 -2096
- package/skills/cometchat-android-v5-calls-sdk/SKILL.md +206 -0
- package/skills/cometchat-android-v5-calls-sdk/references/build-truth.md +63 -0
- package/skills/cometchat-android-v5-calls-sdk/references/docs-map.md +119 -0
- package/skills/cometchat-android-v5-calls-sdk/references/method-map.md +53 -0
- package/skills/cometchat-android-v5-calls-sdk/references/pitfalls.md +72 -0
- package/skills/cometchat-android-v5-calls-sdk/references/ringing.md +92 -0
- package/skills/cometchat-android-v5-calls-sdk/references/user-switch.md +90 -0
- package/skills/cometchat-android-v5-sdk/SKILL.md +127 -0
- package/skills/cometchat-android-v5-sdk/references/app-surface.md +88 -0
- package/skills/cometchat-android-v5-sdk/references/docs-map.md +91 -0
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +51 -137
- package/skills/cometchat-android-v6-calls/SKILL.md +128 -411
- package/skills/cometchat-android-v6-compose-components/SKILL.md +84 -194
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +66 -411
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +154 -237
- package/skills/cometchat-android-v6-core/SKILL.md +236 -672
- package/skills/cometchat-android-v6-core/references/anti-patterns.md +31 -0
- package/skills/cometchat-android-v6-core/references/component-props.md +168 -0
- package/skills/cometchat-android-v6-core/references/docs-map.md +153 -0
- package/skills/cometchat-android-v6-core/references/layout.md +112 -0
- package/skills/cometchat-android-v6-core/references/lifecycle.md +75 -0
- package/skills/cometchat-android-v6-core/references/setup-credentials.md +105 -0
- package/skills/cometchat-android-v6-core/references/troubleshooting.md +36 -0
- package/skills/cometchat-android-v6-events/SKILL.md +46 -184
- package/skills/cometchat-android-v6-extensions/SKILL.md +39 -179
- package/skills/cometchat-android-v6-features/SKILL.md +74 -143
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +75 -193
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +67 -419
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +77 -223
- package/skills/cometchat-android-v6-migration/SKILL.md +67 -378
- package/skills/cometchat-android-v6-production/SKILL.md +40 -179
- package/skills/cometchat-android-v6-push/SKILL.md +39 -289
- package/skills/cometchat-android-v6-testing/SKILL.md +50 -265
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +70 -254
- package/skills/cometchat-angular-v5-calls/SKILL.md +193 -0
- package/skills/cometchat-angular-v5-components/SKILL.md +131 -0
- package/skills/cometchat-angular-v5-components/references/catalog.md +111 -0
- package/skills/cometchat-angular-v5-components/references/host-composed.md +46 -0
- package/skills/cometchat-angular-v5-core/SKILL.md +300 -0
- package/skills/cometchat-angular-v5-core/references/anti-patterns.md +49 -0
- package/skills/cometchat-angular-v5-core/references/component-props.md +55 -0
- package/skills/cometchat-angular-v5-core/references/dependencies.md +66 -0
- package/skills/cometchat-angular-v5-core/references/docs-map.md +132 -0
- package/skills/cometchat-angular-v5-core/references/layout.md +64 -0
- package/skills/cometchat-angular-v5-core/references/lifecycle.md +202 -0
- package/skills/cometchat-angular-v5-core/references/setup-credentials.md +137 -0
- package/skills/cometchat-angular-v5-core/references/theming.md +70 -0
- package/skills/cometchat-angular-v5-core/references/troubleshooting.md +27 -0
- package/skills/cometchat-angular-v5-customization/SKILL.md +94 -0
- package/skills/cometchat-angular-v5-features/SKILL.md +107 -0
- package/skills/cometchat-angular-v5-features/references/custom-messages.md +133 -0
- package/skills/cometchat-angular-v5-features/references/formatters.md +28 -0
- package/skills/cometchat-angular-v5-features/references/host-composed-extensions.md +85 -0
- package/skills/cometchat-angular-v5-migration/SKILL.md +40 -0
- package/skills/cometchat-angular-v5-migration/references/migration-guide.md +165 -0
- package/skills/cometchat-angular-v5-patterns/SKILL.md +107 -0
- package/skills/cometchat-angular-v5-placement/SKILL.md +133 -0
- package/skills/cometchat-angular-v5-placement/references/combined-app.md +174 -0
- package/skills/cometchat-angular-v5-placement/references/core-surface.md +199 -0
- package/skills/cometchat-angular-v5-production/SKILL.md +101 -0
- package/skills/cometchat-angular-v5-push/SKILL.md +61 -0
- package/skills/cometchat-angular-v5-testing/SKILL.md +112 -0
- package/skills/cometchat-angular-v5-troubleshooting/SKILL.md +96 -0
- package/skills/cometchat-flutter-v5-sdk/SKILL.md +188 -0
- package/skills/cometchat-flutter-v5-sdk/references/doc-corrections.md +55 -0
- package/skills/cometchat-flutter-v5-sdk/references/docs-map.md +211 -0
- package/skills/cometchat-flutter-v5-sdk/references/platform-notes.md +48 -0
- package/skills/cometchat-flutter-v5-sdk/references/transcription.md +87 -0
- package/skills/cometchat-flutter-v6-calls/SKILL.md +75 -387
- package/skills/cometchat-flutter-v6-components/SKILL.md +88 -361
- package/skills/cometchat-flutter-v6-core/SKILL.md +154 -593
- package/skills/cometchat-flutter-v6-core/references/anti-patterns.md +55 -0
- package/skills/cometchat-flutter-v6-core/references/docs-map.md +143 -0
- package/skills/cometchat-flutter-v6-core/references/layout.md +45 -0
- package/skills/cometchat-flutter-v6-core/references/lifecycle.md +87 -0
- package/skills/cometchat-flutter-v6-core/references/setup-credentials.md +84 -0
- package/skills/cometchat-flutter-v6-core/references/troubleshooting.md +26 -0
- package/skills/cometchat-flutter-v6-customization/SKILL.md +70 -712
- package/skills/cometchat-flutter-v6-events/SKILL.md +79 -174
- package/skills/cometchat-flutter-v6-features/SKILL.md +55 -394
- package/skills/cometchat-flutter-v6-migration/SKILL.md +68 -367
- package/skills/cometchat-flutter-v6-migration/references/migration-guide.md +131 -0
- package/skills/cometchat-flutter-v6-patterns/SKILL.md +61 -0
- package/skills/cometchat-flutter-v6-placement/SKILL.md +94 -381
- package/skills/cometchat-flutter-v6-production/SKILL.md +58 -615
- package/skills/cometchat-flutter-v6-push/SKILL.md +46 -455
- package/skills/cometchat-flutter-v6-testing/SKILL.md +68 -299
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +54 -878
- package/skills/cometchat-ios-calls/SKILL.md +105 -511
- package/skills/cometchat-ios-components/SKILL.md +44 -834
- package/skills/cometchat-ios-core/SKILL.md +181 -1068
- package/skills/cometchat-ios-core/references/anti-patterns.md +80 -0
- package/skills/cometchat-ios-core/references/docs-map.md +123 -0
- package/skills/cometchat-ios-core/references/install.md +23 -0
- package/skills/cometchat-ios-core/references/layout.md +186 -0
- package/skills/cometchat-ios-core/references/setup-credentials.md +197 -0
- package/skills/cometchat-ios-core/references/swiftui.md +91 -0
- package/skills/cometchat-ios-core/references/troubleshooting.md +100 -0
- package/skills/cometchat-ios-customization/SKILL.md +33 -968
- package/skills/cometchat-ios-features/SKILL.md +29 -738
- package/skills/cometchat-ios-migration/SKILL.md +39 -0
- package/skills/cometchat-ios-placement/SKILL.md +51 -729
- package/skills/cometchat-ios-push/SKILL.md +24 -602
- package/skills/cometchat-ios-v5-sdk/SKILL.md +161 -0
- package/skills/cometchat-ios-v5-sdk/references/docs-map.md +326 -0
- package/skills/cometchat-js-v5-sdk/SKILL.md +95 -0
- package/skills/cometchat-js-v5-sdk/references/docs-map.md +114 -0
- package/skills/cometchat-onboarding/SKILL.md +89 -0
- package/skills/cometchat-onboarding/references/archetypes.md +51 -0
- package/skills/cometchat-onboarding/references/calling-first.md +77 -0
- package/skills/cometchat-onboarding/references/not-in-this-pack.md +8 -0
- package/skills/cometchat-onboarding/references/plan-artifact.md +133 -0
- package/skills/cometchat-onboarding/references/platforms.md +90 -0
- package/skills/cometchat-react-native-bare-patterns/SKILL.md +120 -0
- package/skills/cometchat-react-native-calls/SKILL.md +200 -0
- package/skills/cometchat-react-native-components/SKILL.md +142 -0
- package/skills/cometchat-react-native-core/SKILL.md +313 -0
- package/skills/cometchat-react-native-core/references/anti-patterns.md +79 -0
- package/skills/cometchat-react-native-core/references/component-props.md +105 -0
- package/skills/cometchat-react-native-core/references/dependencies.md +62 -0
- package/skills/cometchat-react-native-core/references/docs-map.md +126 -0
- package/skills/cometchat-react-native-core/references/layout.md +61 -0
- package/skills/cometchat-react-native-core/references/lifecycle.md +64 -0
- package/skills/cometchat-react-native-core/references/setup-credentials.md +39 -0
- package/skills/cometchat-react-native-customization/SKILL.md +198 -0
- package/skills/cometchat-react-native-expo-patterns/SKILL.md +116 -0
- package/skills/cometchat-react-native-features/SKILL.md +122 -0
- package/skills/cometchat-react-native-migration/SKILL.md +103 -0
- package/skills/cometchat-react-native-placement/SKILL.md +158 -0
- package/skills/cometchat-react-native-production/SKILL.md +78 -0
- package/skills/cometchat-react-native-push/SKILL.md +88 -0
- package/skills/cometchat-react-native-sdk/SKILL.md +126 -0
- package/skills/cometchat-react-native-sdk/references/method-map.md +239 -0
- package/skills/cometchat-react-native-sdk/references/page-map.md +96 -0
- package/skills/cometchat-react-native-testing/SKILL.md +94 -0
- package/skills/cometchat-react-native-troubleshooting/SKILL.md +116 -0
- package/skills/cometchat-react-native-v5-sdk/SKILL.md +150 -0
- package/skills/cometchat-react-native-v5-sdk/references/docs-map.md +127 -0
- package/skills/cometchat-react-native-v5-sdk/references/ringing-voip.md +369 -0
- package/skills/cometchat-react-v7-calls/SKILL.md +75 -0
- package/skills/cometchat-react-v7-components/SKILL.md +72 -0
- package/skills/cometchat-react-v7-core/SKILL.md +101 -0
- package/skills/cometchat-react-v7-core/references/anti-patterns.md +19 -0
- package/skills/cometchat-react-v7-core/references/component-props.md +82 -0
- package/skills/cometchat-react-v7-core/references/dependencies.md +23 -0
- package/skills/cometchat-react-v7-core/references/docs-map.md +117 -0
- package/skills/cometchat-react-v7-core/references/i18n-rtl-a11y.md +22 -0
- package/skills/cometchat-react-v7-core/references/layout.md +158 -0
- package/skills/cometchat-react-v7-core/references/lifecycle.md +74 -0
- package/skills/cometchat-react-v7-core/references/setup-credentials.md +58 -0
- package/skills/cometchat-react-v7-core/references/ssr.md +11 -0
- package/skills/cometchat-react-v7-core/references/theming.md +52 -0
- package/skills/cometchat-react-v7-core/references/troubleshooting.md +28 -0
- package/skills/cometchat-react-v7-customization/SKILL.md +84 -0
- package/skills/cometchat-react-v7-features/SKILL.md +92 -0
- package/skills/cometchat-react-v7-migration/SKILL.md +39 -0
- package/skills/cometchat-react-v7-migration/references/migration-guide.md +119 -0
- package/skills/cometchat-react-v7-patterns/SKILL.md +43 -0
- package/skills/cometchat-react-v7-placement/SKILL.md +106 -0
- package/skills/cometchat-react-v7-placement/references/recipes.md +354 -0
- package/skills/cometchat-react-v7-push/SKILL.md +53 -0
- package/test-suite/README.md +70 -0
- package/test-suite/catalogs/android-calls-v5.json +830 -0
- package/test-suite/catalogs/android-calls-v5.symbols.txt +499 -0
- package/test-suite/catalogs/android-v6.json +1646 -0
- package/test-suite/catalogs/android-v6.symbols.txt +298 -0
- package/test-suite/catalogs/angular-v5.json +7587 -0
- package/test-suite/catalogs/flutter-calls-v5.json +196 -0
- package/test-suite/catalogs/flutter-calls-v5.symbols.txt +59 -0
- package/test-suite/catalogs/flutter-v6.json +651 -0
- package/test-suite/catalogs/ios-calls-v5.json +158 -0
- package/test-suite/catalogs/ios-calls-v5.symbols.txt +70 -0
- package/test-suite/catalogs/ios-v5.json +1383 -0
- package/test-suite/catalogs/ios-v5.symbols.txt +699 -0
- package/test-suite/catalogs/rn-calls-v5.json +134 -0
- package/test-suite/catalogs/rn-sdk-v4.json +672 -0
- package/test-suite/catalogs/rn-v5.json +449 -0
- package/test-suite/catalogs/sdk-android-v5.json +514 -0
- package/test-suite/catalogs/sdk-android-v5.symbols.txt +254 -0
- package/test-suite/catalogs/sdk-jsv4.json +800 -0
- package/test-suite/catalogs/web-calls-v5.json +195 -0
- package/test-suite/catalogs/web-v7.json +1243 -0
- package/test-suite/scripts/build-registry.mjs +113 -0
- package/test-suite/scripts/catalog-refresh-dart.mjs +151 -0
- package/test-suite/scripts/catalog-refresh.mjs +100 -0
- package/test-suite/scripts/lint-skills.mjs +909 -0
- package/test-suite/scripts/measure-tokens.mjs +169 -0
- package/test-suite/scripts/typecheck-fences-dart.mjs +437 -0
- package/test-suite/scripts/typecheck-fences-kotlin.mjs +269 -0
- package/test-suite/scripts/typecheck-fences.mjs +206 -0
- package/test-suite/scripts/verify-catalog.mjs +242 -0
- package/test-suite/scripts/verify-contract-fences.mjs +94 -0
- package/test-suite/scripts/verify-detection.mjs +178 -0
- package/test-suite/scripts/verify-docs-base.mjs +91 -0
- package/test-suite/scripts/verify-family-agnostic.mjs +130 -0
- package/test-suite/scripts/verify-golden-path.mjs +138 -0
- package/test-suite/scripts/verify-oracle-components.mjs +133 -0
- package/test-suite/scripts/verify-template-bindings.mjs +148 -0
- package/test-suite/typecheck/angular-v5/package.json +21 -0
- package/test-suite/typecheck/angular-v5/tsconfig.json +21 -0
- package/test-suite/typecheck/flutter-v6/analysis_options.yaml +25 -0
- package/test-suite/typecheck/flutter-v6/pubspec.yaml +21 -0
- package/test-suite/typecheck/web-v7/package.json +18 -0
- package/test-suite/typecheck/web-v7/tsconfig.json +19 -0
- package/bin/install.js +0 -1003
- package/skills/.claude-plugin/marketplace.json +0 -86
- package/skills/cometchat/references/asking-questions.md +0 -48
- package/skills/cometchat-a11y/SKILL.md +0 -477
- package/skills/cometchat-android-v5/SKILL.md +0 -121
- package/skills/cometchat-android-v5-calls/SKILL.md +0 -427
- package/skills/cometchat-android-v5-calls/references/README.md +0 -53
- package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +0 -197
- package/skills/cometchat-android-v5-calls/references/audio-controls.md +0 -91
- package/skills/cometchat-android-v5-calls/references/background-handling.md +0 -168
- package/skills/cometchat-android-v5-calls/references/call-layouts.md +0 -131
- package/skills/cometchat-android-v5-calls/references/call-logs.md +0 -113
- package/skills/cometchat-android-v5-calls/references/call-session.md +0 -274
- package/skills/cometchat-android-v5-calls/references/custom-ui.md +0 -150
- package/skills/cometchat-android-v5-calls/references/event-listeners.md +0 -123
- package/skills/cometchat-android-v5-calls/references/group-calls.md +0 -205
- package/skills/cometchat-android-v5-calls/references/idle-timeout.md +0 -117
- package/skills/cometchat-android-v5-calls/references/in-call-chat.md +0 -134
- package/skills/cometchat-android-v5-calls/references/join-session.md +0 -120
- package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +0 -222
- package/skills/cometchat-android-v5-calls/references/participant-management.md +0 -110
- package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +0 -106
- package/skills/cometchat-android-v5-calls/references/raise-hand.md +0 -248
- package/skills/cometchat-android-v5-calls/references/recording.md +0 -101
- package/skills/cometchat-android-v5-calls/references/ringing-integration.md +0 -152
- package/skills/cometchat-android-v5-calls/references/screen-sharing.md +0 -78
- package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +0 -215
- package/skills/cometchat-android-v5-calls/references/session-settings.md +0 -121
- package/skills/cometchat-android-v5-calls/references/setup.md +0 -137
- package/skills/cometchat-android-v5-calls/references/share-invite.md +0 -156
- package/skills/cometchat-android-v5-calls/references/video-controls.md +0 -87
- package/skills/cometchat-android-v5-calls/references/voip-calling.md +0 -526
- package/skills/cometchat-android-v5-components/SKILL.md +0 -431
- package/skills/cometchat-android-v5-core/SKILL.md +0 -486
- package/skills/cometchat-android-v5-customization/SKILL.md +0 -469
- package/skills/cometchat-android-v5-extensions/SKILL.md +0 -127
- package/skills/cometchat-android-v5-features/SKILL.md +0 -131
- package/skills/cometchat-android-v5-placement/SKILL.md +0 -277
- package/skills/cometchat-android-v5-production/SKILL.md +0 -95
- package/skills/cometchat-android-v5-push/SKILL.md +0 -619
- package/skills/cometchat-android-v5-testing/SKILL.md +0 -188
- package/skills/cometchat-android-v5-theming/SKILL.md +0 -167
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +0 -74
- package/skills/cometchat-android-v6/SKILL.md +0 -108
- package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +0 -97
- package/skills/cometchat-android-v6-calls/references/advanced-features.md +0 -87
- package/skills/cometchat-android-v6-calls/references/call-layouts.md +0 -100
- package/skills/cometchat-android-v6-calls/references/call-session.md +0 -163
- package/skills/cometchat-android-v6-calls/references/device-management.md +0 -172
- package/skills/cometchat-android-v6-calls/references/group-calls.md +0 -191
- package/skills/cometchat-android-v6-calls/references/idle-timeout.md +0 -110
- package/skills/cometchat-android-v6-calls/references/in-call-chat.md +0 -141
- package/skills/cometchat-android-v6-calls/references/raise-hand.md +0 -188
- package/skills/cometchat-android-v6-calls/references/ringing-integration.md +0 -176
- package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +0 -127
- package/skills/cometchat-android-v6-calls/references/share-invite.md +0 -105
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +0 -250
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +0 -233
- package/skills/cometchat-angular-calls/SKILL.md +0 -378
- package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +0 -96
- package/skills/cometchat-angular-calls/references/call-layouts.md +0 -123
- package/skills/cometchat-angular-calls/references/call-session.md +0 -167
- package/skills/cometchat-angular-calls/references/custom-ui.md +0 -239
- package/skills/cometchat-angular-calls/references/device-management.md +0 -154
- package/skills/cometchat-angular-calls/references/group-calls.md +0 -433
- package/skills/cometchat-angular-calls/references/idle-timeout.md +0 -161
- package/skills/cometchat-angular-calls/references/in-call-chat.md +0 -148
- package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +0 -205
- package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +0 -53
- package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +0 -184
- package/skills/cometchat-angular-calls/references/picture-in-picture.md +0 -285
- package/skills/cometchat-angular-calls/references/raise-hand.md +0 -172
- package/skills/cometchat-angular-calls/references/recording-screen-share.md +0 -260
- package/skills/cometchat-angular-calls/references/ringing-integration.md +0 -133
- package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +0 -100
- package/skills/cometchat-angular-calls/references/share-invite.md +0 -122
- package/skills/cometchat-angular-calls/references/virtual-background.md +0 -29
- package/skills/cometchat-angular-components/SKILL.md +0 -235
- package/skills/cometchat-angular-core/SKILL.md +0 -386
- package/skills/cometchat-angular-customization/SKILL.md +0 -616
- package/skills/cometchat-angular-features/SKILL.md +0 -329
- package/skills/cometchat-angular-patterns/SKILL.md +0 -256
- package/skills/cometchat-angular-placement/SKILL.md +0 -314
- package/skills/cometchat-angular-production/SKILL.md +0 -564
- package/skills/cometchat-angular-push/SKILL.md +0 -389
- package/skills/cometchat-angular-testing/SKILL.md +0 -605
- package/skills/cometchat-angular-theming/SKILL.md +0 -290
- package/skills/cometchat-angular-troubleshooting/SKILL.md +0 -364
- package/skills/cometchat-astro-patterns/SKILL.md +0 -708
- package/skills/cometchat-calls/SKILL.md +0 -364
- package/skills/cometchat-calls/references/use-case-broadcast.md +0 -199
- package/skills/cometchat-calls/references/use-case-marketplace.md +0 -157
- package/skills/cometchat-calls/references/use-case-support.md +0 -189
- package/skills/cometchat-calls/references/use-case-team.md +0 -180
- package/skills/cometchat-calls/references/use-case-telehealth.md +0 -153
- package/skills/cometchat-components/SKILL.md +0 -1142
- package/skills/cometchat-core/SKILL.md +0 -1048
- package/skills/cometchat-customization/SKILL.md +0 -580
- package/skills/cometchat-customization/references/component-catalog.md +0 -236
- package/skills/cometchat-features/SKILL.md +0 -861
- package/skills/cometchat-flutter-v5/SKILL.md +0 -173
- package/skills/cometchat-flutter-v5-calls/SKILL.md +0 -453
- package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +0 -193
- package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +0 -103
- package/skills/cometchat-flutter-v5-calls/references/call-session.md +0 -285
- package/skills/cometchat-flutter-v5-calls/references/device-management.md +0 -124
- package/skills/cometchat-flutter-v5-calls/references/group-calls.md +0 -181
- package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +0 -99
- package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +0 -135
- package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +0 -210
- package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +0 -255
- package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +0 -196
- package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +0 -101
- package/skills/cometchat-flutter-v5-calls/references/share-invite.md +0 -148
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +0 -118
- package/skills/cometchat-flutter-v5-core/SKILL.md +0 -239
- package/skills/cometchat-flutter-v5-customization/SKILL.md +0 -358
- package/skills/cometchat-flutter-v5-events/SKILL.md +0 -156
- package/skills/cometchat-flutter-v5-messages/SKILL.md +0 -259
- package/skills/cometchat-flutter-v5-production/SKILL.md +0 -216
- package/skills/cometchat-flutter-v5-push/SKILL.md +0 -285
- package/skills/cometchat-flutter-v5-testing/SKILL.md +0 -401
- package/skills/cometchat-flutter-v5-theming/SKILL.md +0 -161
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +0 -130
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +0 -152
- package/skills/cometchat-flutter-v6/SKILL.md +0 -446
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +0 -136
- package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +0 -89
- package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +0 -105
- package/skills/cometchat-flutter-v6-calls/references/call-session.md +0 -229
- package/skills/cometchat-flutter-v6-calls/references/device-management.md +0 -105
- package/skills/cometchat-flutter-v6-calls/references/group-calls.md +0 -190
- package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +0 -88
- package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +0 -125
- package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +0 -275
- package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +0 -171
- package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +0 -93
- package/skills/cometchat-flutter-v6-calls/references/share-invite.md +0 -102
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +0 -238
- package/skills/cometchat-flutter-v6-messages/SKILL.md +0 -384
- package/skills/cometchat-flutter-v6-theming/SKILL.md +0 -293
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +0 -224
- package/skills/cometchat-i18n/SKILL.md +0 -419
- package/skills/cometchat-ios/SKILL.md +0 -325
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +0 -174
- package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +0 -45
- package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +0 -188
- package/skills/cometchat-ios-calls/references/call-layouts.md +0 -76
- package/skills/cometchat-ios-calls/references/call-session.md +0 -218
- package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +0 -357
- package/skills/cometchat-ios-calls/references/custom-ui.md +0 -322
- package/skills/cometchat-ios-calls/references/device-management.md +0 -171
- package/skills/cometchat-ios-calls/references/group-calls.md +0 -359
- package/skills/cometchat-ios-calls/references/idle-timeout.md +0 -184
- package/skills/cometchat-ios-calls/references/in-call-chat.md +0 -179
- package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +0 -196
- package/skills/cometchat-ios-calls/references/picture-in-picture.md +0 -246
- package/skills/cometchat-ios-calls/references/raise-hand.md +0 -26
- package/skills/cometchat-ios-calls/references/recording-screen-share.md +0 -252
- package/skills/cometchat-ios-calls/references/ringing-integration.md +0 -143
- package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +0 -267
- package/skills/cometchat-ios-calls/references/share-invite.md +0 -148
- package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +0 -246
- package/skills/cometchat-ios-calls/references/voip-cert-setup.md +0 -166
- package/skills/cometchat-ios-production/SKILL.md +0 -738
- package/skills/cometchat-ios-testing/SKILL.md +0 -376
- package/skills/cometchat-ios-theming/SKILL.md +0 -667
- package/skills/cometchat-ios-troubleshooting/SKILL.md +0 -1003
- package/skills/cometchat-native-bare-patterns/SKILL.md +0 -550
- package/skills/cometchat-native-calls/SKILL.md +0 -669
- package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +0 -203
- package/skills/cometchat-native-calls/references/call-layouts.md +0 -125
- package/skills/cometchat-native-calls/references/call-session.md +0 -182
- package/skills/cometchat-native-calls/references/custom-ui.md +0 -254
- package/skills/cometchat-native-calls/references/device-management.md +0 -158
- package/skills/cometchat-native-calls/references/expo-vs-bare.md +0 -179
- package/skills/cometchat-native-calls/references/group-calls.md +0 -296
- package/skills/cometchat-native-calls/references/idle-timeout.md +0 -128
- package/skills/cometchat-native-calls/references/in-call-chat.md +0 -145
- package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +0 -72
- package/skills/cometchat-native-calls/references/picture-in-picture.md +0 -276
- package/skills/cometchat-native-calls/references/raise-hand.md +0 -205
- package/skills/cometchat-native-calls/references/recording-screen-share.md +0 -169
- package/skills/cometchat-native-calls/references/ringing-integration.md +0 -118
- package/skills/cometchat-native-calls/references/server-push-bridge.md +0 -135
- package/skills/cometchat-native-calls/references/server-push-payloads.md +0 -193
- package/skills/cometchat-native-calls/references/share-invite.md +0 -146
- package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +0 -319
- package/skills/cometchat-native-components/SKILL.md +0 -628
- package/skills/cometchat-native-core/SKILL.md +0 -679
- package/skills/cometchat-native-customization/SKILL.md +0 -716
- package/skills/cometchat-native-expo-patterns/SKILL.md +0 -552
- package/skills/cometchat-native-features/SKILL.md +0 -638
- package/skills/cometchat-native-placement/SKILL.md +0 -509
- package/skills/cometchat-native-production/SKILL.md +0 -700
- package/skills/cometchat-native-push/SKILL.md +0 -594
- package/skills/cometchat-native-testing/SKILL.md +0 -582
- package/skills/cometchat-native-theming/SKILL.md +0 -681
- package/skills/cometchat-native-troubleshooting/SKILL.md +0 -501
- package/skills/cometchat-nextjs-patterns/SKILL.md +0 -899
- package/skills/cometchat-placement/SKILL.md +0 -1360
- package/skills/cometchat-production/SKILL.md +0 -1027
- package/skills/cometchat-react-calls/SKILL.md +0 -749
- package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +0 -146
- package/skills/cometchat-react-calls/references/call-layouts.md +0 -160
- package/skills/cometchat-react-calls/references/call-session.md +0 -235
- package/skills/cometchat-react-calls/references/custom-ui.md +0 -247
- package/skills/cometchat-react-calls/references/device-management.md +0 -210
- package/skills/cometchat-react-calls/references/group-calls.md +0 -257
- package/skills/cometchat-react-calls/references/idle-timeout.md +0 -188
- package/skills/cometchat-react-calls/references/in-call-chat.md +0 -212
- package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +0 -170
- package/skills/cometchat-react-calls/references/picture-in-picture.md +0 -245
- package/skills/cometchat-react-calls/references/raise-hand.md +0 -238
- package/skills/cometchat-react-calls/references/recording-screen-share.md +0 -144
- package/skills/cometchat-react-calls/references/ringing-integration.md +0 -255
- package/skills/cometchat-react-calls/references/server-web-push-vapid.md +0 -241
- package/skills/cometchat-react-calls/references/share-invite.md +0 -175
- package/skills/cometchat-react-calls/references/testing-calls-on-web.md +0 -216
- package/skills/cometchat-react-calls/references/virtual-background.md +0 -32
- package/skills/cometchat-react-calls/references/voip-and-web-push.md +0 -165
- package/skills/cometchat-react-patterns/SKILL.md +0 -628
- package/skills/cometchat-react-push/SKILL.md +0 -634
- package/skills/cometchat-react-router-patterns/SKILL.md +0 -758
- package/skills/cometchat-react-testing/SKILL.md +0 -413
- package/skills/cometchat-theming/SKILL.md +0 -498
- package/skills/cometchat-troubleshooting/SKILL.md +0 -294
|
@@ -1,539 +1,133 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cometchat-ios-calls
|
|
3
|
-
description:
|
|
3
|
+
description: "Add voice and video calling to an iOS CometChat app — call buttons, incoming/ongoing call screens, call logs, and CallKit ringing. Triggers: 'add video calling ios', 'cometchat voice call swift', 'incoming call screen ios', 'call logs cometchat ios'."
|
|
4
4
|
license: "MIT"
|
|
5
|
-
compatibility: "
|
|
5
|
+
compatibility: "CometChatUIKitSwift 5.1.22 · CometChatCallsSDK 5.0.3 · iOS 15.1+"
|
|
6
6
|
metadata:
|
|
7
7
|
author: "CometChat"
|
|
8
|
-
version: "
|
|
9
|
-
tags: "cometchat ios calls voice video
|
|
8
|
+
version: "1.0.0"
|
|
9
|
+
tags: "cometchat ios calls voice video callkit swift v5"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Companion skills (read first)
|
|
13
|
+
- `cometchat-ios-core` owns setup and the chat surface. This skill ADDS calling. Note core ALREADY links `CometChatCallsSDK` at exactly 5.0.3 — on 5.1.22 (as since 5.1.19) the kit's interface imports it, so it is required even for chat-only builds. Do not add it twice or at a different version.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
## Use this skill when
|
|
16
|
+
"add voice/video calling", "show an incoming call screen", "add call history".
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
- **Additive** — calls layered onto an existing CometChat iOS UI Kit integration. The kit's `CometChatMessageHeader` already exposes call buttons; this skill wires them and mounts the global call listener.
|
|
18
|
+
## Calls has its OWN login — the UI Kit's login is not enough
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
**Ground truth:**
|
|
24
|
-
- SDK source — `calls-sdk-ios-5/sdk/`
|
|
25
|
-
- Sample app — `calls-sdk-ios-5/sample-apps/cometchat-calls-sample-app-ios/`
|
|
26
|
-
- `Package.swift` — `https://github.com/cometchat/calls-sdk-ios.git` (SPM)
|
|
27
|
-
- Public docs — https://www.cometchat.com/docs/calls/ios/overview
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## iOS Calls SDK v5 resolution — verified working (re-checked 2026-06-04)
|
|
32
|
-
|
|
33
|
-
> An earlier draft of this skill warned that "the iOS Calls SDK v5 binary is broken / missing from Cloudsmith — stay on v4.2.x." **That warning was wrong and has been removed.** It was based on a hand-constructed URL (`…/raw/versions/124.0.4/CometChatWebRTC-124.0.4.xcframework.zip`) that 404s — but that is NOT the path the podspec/`Package.swift` actually fetches, so its 404 never proved anything. Verified 2026-06-04:
|
|
34
|
-
> - **Additive (UI Kit) path:** `CometChatCallsSDK` v5 ships **vendored inside `CometChatUIKitSwift`** — a clean `pod install` resolves `CometChatUIKitSwift (5.1.13)` (which bundles the v5 CallsSDK framework) with **no 404**. The audited `CometChatCallsSDK.swiftinterface` (v5 shape: `generateToken`/`startSession`, no `login`) came straight out of that resolved framework.
|
|
35
|
-
> - **Standalone path:** `CometChatCallsSDK` v5.0.0 is consumable via CocoaPods (e.g. the internal VoIP+APNs sample under Linear ENG-35167 builds against it).
|
|
36
|
-
>
|
|
37
|
-
> If you ever DO hit a missing-WebRTC binary on a direct standalone `pod 'CometChatCallsSDK'` install, treat it as an environment/registry hiccup and check the current podspec URL — it is not a known blanket failure, and there is no open vendor ticket for it.
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## 1. The seven hard rules — iOS specialization
|
|
42
|
-
|
|
43
|
-
> ⚠️ **TOP PRIORITY (ENG-35710): Auth-token passing is the most-broken step on iOS Calls integrations.** Unlike Android / Flutter / JS, the **iOS Calls SDK 5.x has NO separate login step** — there is no `CometChatCalls.login(...)` and no `CometChatCalls.getLoggedInUser()` (those are phantom; verified absent from `CometChatCallsSDK`). Auth is supplied **per session** as the `authToken:` argument to `CometChatCalls.generateToken(authToken:sessionID:)`. Every tester who hit "calls don't work" on iOS traced back to that token: (a) the token was empty/nil → `generateToken` fails with **"auth token cannot be null"**; (b) a server-minted token expired between mint and `generateToken` (default ~30-minute TTL); (c) the client-side `apiKey` was passed instead of the user's auth token. Before scaffolding ANY iOS calls code, confirm the auth path (dev: read `CometChat.getUserAuthToken()`; production: fetch a fresh server-minted token) and feed it to `generateToken`. Mixing them is the canonical "ringing but never joins" iOS failure mode.
|
|
44
|
-
|
|
45
|
-
### 1.0 The iOS Calls SDK has NO separate login (v5)
|
|
46
|
-
|
|
47
|
-
Unlike the Android / Flutter / JS Calls SDKs, **`CometChatCalls` on iOS has no `login()` and no `getLoggedInUser()`** — those methods do not exist in `CometChatCallsSDK` 5.x. There is nothing to "log in" to. Once the Chat SDK session exists, you authorize each call session by passing an **auth token** to `generateToken(authToken:sessionID:)`, then `startSession(callToken:callSetting:view:)` with the returned call token (full flow in §1.1).
|
|
48
|
-
|
|
49
|
-
```swift
|
|
50
|
-
import CometChatSDK
|
|
51
|
-
import CometChatCallsSDK
|
|
52
|
-
|
|
53
|
-
// Chat SDK login is the ONLY login. (UI Kit users: CometChatUIKit.login already did this.)
|
|
54
|
-
CometChat.login(UID: uid, authKey: AUTH_KEY) { user in
|
|
55
|
-
// Chat SDK ready. No CometChatCalls.login() exists — do NOT call it.
|
|
56
|
-
// The incoming-call listener can be registered now; per-call auth happens via generateToken.
|
|
57
|
-
} onError: { error in
|
|
58
|
-
// chat login failed
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Dev: the auth token for generateToken comes from the Chat SDK:
|
|
62
|
-
let authToken = CometChat.getUserAuthToken() // String? — pass to generateToken(authToken:)
|
|
63
|
-
// Production: fetch a fresh server-minted token from your backend instead.
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
**Surprises:**
|
|
67
|
-
- There is **no Calls-SDK session to persist** — the Chat SDK's Keychain session is the only persisted login. On app start just confirm `CometChat.getLoggedInUser() != nil`.
|
|
68
|
-
- `generateToken` / `startSession` errors hit the `onError` closure (not `do/try/catch`). The error type is `CometChatCallException` — has `errorDescription` and `errorCode`.
|
|
69
|
-
|
|
70
|
-
### 1.1 Dual-SDK contract
|
|
71
|
-
|
|
72
|
-
Chat SDK (`CometChatSDK`) initiates ringing; Calls SDK (`CometChatCallsSDK`) runs the WebRTC session. There is no two-`Call`-classes problem on iOS — Swift's module separation prevents it. But the API split still exists:
|
|
73
|
-
|
|
74
|
-
```swift
|
|
75
|
-
// ✓ RIGHT — initiate ringing (Chat SDK)
|
|
76
|
-
import CometChatSDK
|
|
77
|
-
|
|
78
|
-
let outgoing = Call(receiverId: receiverUid, callType: .video, receiverType: .user)
|
|
79
|
-
CometChat.initiateCall(call: outgoing, onSuccess: { initiated in
|
|
80
|
-
// initiated.sessionID is what the Calls SDK will join
|
|
81
|
-
}, onError: { error in
|
|
82
|
-
// surface to UI
|
|
83
|
-
})
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
```swift
|
|
87
|
-
// ✓ RIGHT — start the WebRTC session (Calls SDK 5.x) after acceptance.
|
|
88
|
-
// iOS Calls SDK 5.x is a TWO-STEP flow: generateToken → startSession.
|
|
89
|
-
// There is NO joinSession, NO CallSession singleton, and NO SessionSettingsBuilder
|
|
90
|
-
// in the 5.x SDK — those are phantom. The real builder is CallSettingsBuilder.
|
|
91
|
-
// - CallSettingsBuilder (NOT SessionSettingsBuilder) builds the CallSettings
|
|
92
|
-
// - generateToken(authToken:sessionID:) FIRST, then startSession(callToken:callSetting:view:)
|
|
93
|
-
// - Attach the event listener via CallSettingsBuilder.setDelegate(_:) (CallsEventsDelegate)
|
|
94
|
-
import CometChatCallsSDK
|
|
95
|
-
|
|
96
|
-
let settings = CallSettingsBuilder()
|
|
97
|
-
.setStartVideoMuted(false)
|
|
98
|
-
.setStartAudioMuted(false)
|
|
99
|
-
.setDelegate(callListener) // any CallsEventsDelegate — onCallEnded, onUserJoined, …
|
|
100
|
-
.build()
|
|
101
|
-
|
|
102
|
-
// loggedInAuthToken: the current user's auth token — CometChat.getUserAuthToken()
|
|
103
|
-
// (User has NO .authToken property; getUserAuthToken() is the real accessor)
|
|
104
|
-
CometChatCalls.generateToken(authToken: loggedInAuthToken, sessionID: sessionID) { callToken in
|
|
105
|
-
guard let callToken = callToken else { return }
|
|
106
|
-
CometChatCalls.startSession(
|
|
107
|
-
callToken: callToken,
|
|
108
|
-
callSetting: settings,
|
|
109
|
-
view: callContainerView // UIView with measurable bounds
|
|
110
|
-
) { _ in
|
|
111
|
-
// session started — the call UI is rendered into callContainerView
|
|
112
|
-
} onError: { error in
|
|
113
|
-
print("startSession failed: \(error?.errorDescription ?? "unknown")")
|
|
114
|
-
}
|
|
115
|
-
} onError: { error in
|
|
116
|
-
print("generateToken failed: \(error?.errorDescription ?? "unknown")")
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### 1.1a End-to-end initiate→join sequence (ENG-35710)
|
|
121
|
-
|
|
122
|
-
After `CometChat.initiateCall` the caller's session is NOT auto-joined — the gap between *initiation* and *joining* is the second canonical iOS failure (after auth-token). Three events must fire in sequence; the caller side handles each in a different callback.
|
|
123
|
-
|
|
124
|
-
> **Corrected 2026-06-02 against `calls-sdk-ios/sample-apps/cometchat-calls-sample-app-ringing-ios/CometChatCallsRinging/AppState.swift:213`** — the listener protocol is **`CometChatCallDelegate`** (NOT `CometChatCallsListener` as earlier drafts said), and each callback takes TWO parameters (`Call?` + `CometChatException?`), NOT one. Earlier example would not compile.
|
|
125
|
-
|
|
126
|
-
```swift
|
|
127
|
-
// Step A: register the listener on app start (before any call fires)
|
|
128
|
-
// Listener ID is a String; listener instance is "self" or any class conforming
|
|
129
|
-
// to CometChatCallDelegate.
|
|
130
|
-
CometChat.addCallListener(callListenerID, self)
|
|
131
|
-
|
|
132
|
-
// Step B: conform to CometChatCallDelegate (NOT CometChatCallsListener)
|
|
133
|
-
extension YourClass: CometChatCallDelegate {
|
|
134
|
-
// Caller side: the OTHER party accepted — NOW join the session
|
|
135
|
-
func onOutgoingCallAccepted(acceptedCall: Call?, error: CometChatException?) {
|
|
136
|
-
if let error = error { /* surface */ return }
|
|
137
|
-
guard let call = acceptedCall, let sessionID = call.sessionID else { return }
|
|
138
|
-
startCallSession(sessionID: sessionID)
|
|
139
|
-
}
|
|
140
|
-
// Receiver side: incoming call rang — present accept UI; on accept, start the session
|
|
141
|
-
func onIncomingCallReceived(incomingCall: Call?, error: CometChatException?) {
|
|
142
|
-
if let error = error { /* surface */ return }
|
|
143
|
-
guard let call = incomingCall else { return }
|
|
144
|
-
presentIncomingCallUI(for: call) { accepted in
|
|
145
|
-
if accepted {
|
|
146
|
-
CometChat.acceptCall(sessionID: call.sessionID ?? "") { acceptedCall in
|
|
147
|
-
self.startCallSession(sessionID: acceptedCall?.sessionID ?? "")
|
|
148
|
-
} onError: { _ in /* surface */ }
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
func onOutgoingCallRejected(rejectedCall: Call?, error: CometChatException?) { /* end UI, cleanup */ }
|
|
153
|
-
func onIncomingCallCancelled(canceledCall: Call?, error: CometChatException?) { /* dismiss incoming UI — label is canceledCall: (single L) */ }
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// Don't forget to remove the listener on teardown
|
|
157
|
-
// CometChat.removeCallListener(callListenerID)
|
|
158
|
-
|
|
159
|
-
// Step B: kick the call off (caller — your "Call" button taps this)
|
|
160
|
-
let outgoing = Call(receiverId: targetUid, callType: .video, receiverType: .user)
|
|
161
|
-
CometChat.initiateCall(call: outgoing, onSuccess: { initiated in
|
|
162
|
-
// initiated.sessionID is what the session will use — but DO NOT start the
|
|
163
|
-
// session here. Wait for onOutgoingCallAccepted on the listener. Starting before
|
|
164
|
-
// the remote accepts means you're alone in an empty session.
|
|
165
|
-
}, onError: { error in /* surface */ })
|
|
166
|
-
|
|
167
|
-
// Step C: start the session (caller in onOutgoingCallAccepted, receiver after acceptCall)
|
|
168
|
-
// 5.x flow: generateToken(authToken:sessionID:) → startSession(callToken:callSetting:view:)
|
|
169
|
-
func startCallSession(sessionID: String) {
|
|
170
|
-
let settings = CallSettingsBuilder()
|
|
171
|
-
.setStartVideoMuted(false)
|
|
172
|
-
.setStartAudioMuted(false)
|
|
173
|
-
.setDelegate(self) // self conforms to CallsEventsDelegate
|
|
174
|
-
.build()
|
|
175
|
-
CometChatCalls.generateToken(authToken: loggedInAuthToken, sessionID: sessionID) { callToken in
|
|
176
|
-
guard let callToken = callToken else { return }
|
|
177
|
-
CometChatCalls.startSession(
|
|
178
|
-
callToken: callToken,
|
|
179
|
-
callSetting: settings,
|
|
180
|
-
view: callContainerView // UIView WITH non-zero bounds (lay out first)
|
|
181
|
-
) { _ in
|
|
182
|
-
// session started
|
|
183
|
-
} onError: { error in
|
|
184
|
-
print("startSession failed: \(error?.errorDescription ?? "unknown")")
|
|
185
|
-
}
|
|
186
|
-
} onError: { error in
|
|
187
|
-
print("generateToken failed: \(error?.errorDescription ?? "unknown")")
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
The shape: `initiateCall` → wait for `onOutgoingCallAccepted` on your `CometChatCallDelegate` → `generateToken` → `startSession`. Skipping the listener and starting inside `initiateCall`'s `onSuccess` is the "ringing but never joins" trap — you'll see the call connect on the wire but the receiver's accept never reaches your code.
|
|
193
|
-
|
|
194
|
-
### 1.2 CallKit + PushKit are mandatory
|
|
195
|
-
|
|
196
|
-
iOS will not deliver standard push notifications to a backgrounded/terminated app for an incoming call — the app would have to be foregrounded for it to ring. CallKit + PushKit is the only correct path:
|
|
197
|
-
|
|
198
|
-
- **PushKit** delivers VoIP push tokens (separate from APNs tokens) and high-priority VoIP payloads even when the app is terminated
|
|
199
|
-
- **CallKit** presents the system incoming-call UI (lock-screen, even when device is locked) and reports call state to the OS
|
|
200
|
-
- Your `PKPushRegistry` listener calls `CXProvider.reportNewIncomingCall(...)` immediately on receiving the VoIP payload — Apple terminates apps that delay this
|
|
201
|
-
|
|
202
|
-
This pattern is non-negotiable for App Store review on apps that ring users. Standalone mode wires it; additive mode prompts but doesn't force it.
|
|
203
|
-
|
|
204
|
-
### 1.3 Background modes — three required entries
|
|
205
|
-
|
|
206
|
-
In the target's "Signing & Capabilities" → Background Modes:
|
|
207
|
-
|
|
208
|
-
- **`Audio, AirPlay, and Picture in Picture`** — required for ongoing-call audio when backgrounded
|
|
209
|
-
- **`Voice over IP`** — required for PushKit VoIP payload delivery
|
|
210
|
-
- **`Remote notifications`** — required for chat push (keeps existing entitlements working)
|
|
211
|
-
|
|
212
|
-
In `Info.plist`:
|
|
213
|
-
|
|
214
|
-
```xml
|
|
215
|
-
<key>UIBackgroundModes</key>
|
|
216
|
-
<array>
|
|
217
|
-
<string>audio</string>
|
|
218
|
-
<string>voip</string>
|
|
219
|
-
<string>remote-notification</string>
|
|
220
|
-
</array>
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
Apple will reject the app if `voip` is declared but PushKit is not actually used.
|
|
224
|
-
|
|
225
|
-
### 1.4 Server-minted auth tokens
|
|
226
|
-
|
|
227
|
-
Same rule as the chat dispatcher / `cometchat-ios-production`. Production calls path uses `CometChat.login(authToken:)`, not `CometChat.login(uid:authKey:)`.
|
|
228
|
-
|
|
229
|
-
### 1.5 Hangup cleanup — `AVAudioSession` routing
|
|
230
|
-
|
|
231
|
-
Releasing the camera + mic on iOS is straightforward; the gotcha is `AVAudioSession`:
|
|
20
|
+
**`CometChatUIKit.login(uid:)` does NOT authenticate the Calls SDK.** Built without the bootstrap
|
|
21
|
+
below, `CometChatCallLogs` shows "Oops! Looks like something went wrong" — its request goes out
|
|
22
|
+
with an EMPTY `authToken` (measured on 5.1.19/5.0.3). No error points at the cause. After the UI
|
|
23
|
+
Kit login succeeds, run:
|
|
232
24
|
|
|
233
25
|
```swift
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
// CRITICAL: deactivate the audio session, otherwise the speaker stays
|
|
244
|
-
// routed to "earpiece + voice processing" mode and other audio (music,
|
|
245
|
-
// phone calls outside the app) sounds wrong until the user resets it.
|
|
246
|
-
do {
|
|
247
|
-
try AVAudioSession.sharedInstance().setActive(false, options: .notifyOthersOnDeactivation)
|
|
248
|
-
} catch {
|
|
249
|
-
// log but don't block — best-effort cleanup
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// CallKit must be told the call ended, even if WE ended it
|
|
253
|
-
cxProvider.reportCall(with: callUUID, endedAt: Date(), reason: .remoteEnded)
|
|
254
|
-
}
|
|
26
|
+
// DEFAULT — the ai-agent / telemetry-attributed init (persists integrationSource="ai-agent").
|
|
27
|
+
// Takes NO settings argument: it reads the SAME bundled cometchat-settings.json the core skill
|
|
28
|
+
// already ships (Copy Bundle Resources) — do not build a second settings object.
|
|
29
|
+
_ = CometChatCalls.initFromSettings(onSuccess: { _ in
|
|
30
|
+
guard let token = CometChat.getUserAuthToken() else { return }
|
|
31
|
+
CometChatCalls.login(authToken: token,
|
|
32
|
+
onSuccess: { _ in /* calls surfaces are now live */ },
|
|
33
|
+
onError: { error in debugPrint("calls login:", error.errorDescription) })
|
|
34
|
+
}, onError: { error in debugPrint("calls init:", error?.errorDescription ?? "nil") })
|
|
255
35
|
```
|
|
256
36
|
|
|
257
|
-
|
|
37
|
+
⚠️ **Init the Calls SDK via `CometChatCalls.initFromSettings`, NOT the classic
|
|
38
|
+
`CometChatCalls(callsAppSettings: CallAppSettingsBuilder()…)` builder — that path attributes the app
|
|
39
|
+
to `"manual"` and loses the ai-agent telemetry (RULES §5 / AUDIT-175, the SAME rule the headless
|
|
40
|
+
`cometchat-ios-v5-sdk` follows).** The builder init is the **FALLBACK ONLY**, for an app that does not
|
|
41
|
+
bundle `cometchat-settings.json`:
|
|
258
42
|
|
|
259
43
|
```swift
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
CometChatCalls
|
|
263
|
-
|
|
264
|
-
CometChatCalls.startRecording() // stopRecording() to end
|
|
265
|
-
// NOTE: the iOS Calls SDK 5.x has NO local screen-share initiation API
|
|
266
|
-
// (no startScreenShare/stopScreenShare) — iOS can only RECEIVE a remote
|
|
267
|
-
// participant's screen share, not start one.
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
Skipping the `setActive(false, options: .notifyOthersOnDeactivation)` is the canonical "music doesn't resume after the call" bug.
|
|
271
|
-
|
|
272
|
-
### 1.6 Permissions with rationale — Info.plist usage strings
|
|
273
|
-
|
|
274
|
-
Two required entries; iOS rejects builds that record without them:
|
|
275
|
-
|
|
276
|
-
```xml
|
|
277
|
-
<key>NSMicrophoneUsageDescription</key>
|
|
278
|
-
<string>So you can talk during voice and video calls.</string>
|
|
279
|
-
<key>NSCameraUsageDescription</key>
|
|
280
|
-
<string>So you can be seen during video calls.</string>
|
|
44
|
+
// FALLBACK — only when no cometchat-settings.json is bundled. Loses ai-agent attribution.
|
|
45
|
+
let callSettings = CallAppSettingsBuilder().set(appID: appID).set(region: region).build()
|
|
46
|
+
_ = CometChatCalls(callsAppSettings: callSettings, onSuccess: { _ in /* … login as above … */ },
|
|
47
|
+
onError: { error in debugPrint("calls init:", error?.errorDescription ?? "nil") })
|
|
281
48
|
```
|
|
282
49
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
In standalone mode, you do NOT render an in-app incoming-call screen. CallKit's system UI handles it (rule 1.2). Your job is:
|
|
288
|
-
|
|
289
|
-
1. Keep `PKPushRegistry` alive — register in `application(_:didFinishLaunchingWithOptions:)` (UIKit) or `App.init()` (SwiftUI's `@main`)
|
|
290
|
-
2. On VoIP payload → call `CXProvider.reportNewIncomingCall`
|
|
291
|
-
3. Implement `CXProviderDelegate` `provider(_:perform:)` for `CXAnswerCallAction` — this is where you finally call `CometChatCalls.generateToken` then `startSession`
|
|
292
|
-
|
|
293
|
-
In additive mode, the UI Kit's incoming-call view can be used for in-foreground rings; CallKit handles backgrounded/terminated rings.
|
|
50
|
+
**Never do both** — a builder init AFTER `initFromSettings` re-attributes the app to `"manual"`.
|
|
51
|
+
`initFromSettings` fails `SETTINGS_FILE_NOT_FOUND` if the file is not in Copy Bundle Resources — the
|
|
52
|
+
core skill already adds it for chat, so a UI-Kit app that shipped chat first already satisfies this.
|
|
294
53
|
|
|
295
|
-
|
|
54
|
+
The docs' calling-integration page says linking the SDK is enough; it is not — that gap is logged
|
|
55
|
+
for the docs. Chat-only apps skip all of this (they link the Calls SDK purely to satisfy 5.1.19's
|
|
56
|
+
import — see the core skill's install notes).
|
|
296
57
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
**If the developer hasn't asked for a custom incoming-call UI, wire the kit's defaults:**
|
|
300
|
-
|
|
301
|
-
```swift
|
|
302
|
-
// SwiftUI host
|
|
303
|
-
import SwiftUI
|
|
304
|
-
import UIKit
|
|
305
|
-
import CometChatUIKitSwift
|
|
306
|
-
|
|
307
|
-
// The kit ships call UI as UIViewControllers (CometChatIncomingCall / CometChatOutgoingCall /
|
|
308
|
-
// CometChatOngoingCall) — there are NO `…SwiftUI`-suffixed wrappers. Bridge with
|
|
309
|
-
// UIViewControllerRepresentable. Present the controller when your delegate fires (§1.1a);
|
|
310
|
-
// configure it via the kit's IncomingCallConfiguration rather than a constructor arg.
|
|
311
|
-
struct CometChatIncomingCallView: UIViewControllerRepresentable {
|
|
312
|
-
func makeUIViewController(context: Context) -> CometChatIncomingCall {
|
|
313
|
-
CometChatIncomingCall()
|
|
314
|
-
}
|
|
315
|
-
func updateUIViewController(_ vc: CometChatIncomingCall, context: Context) {}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
struct AppRootView: View {
|
|
319
|
-
@State private var hasIncomingCall = false
|
|
320
|
-
var body: some View {
|
|
321
|
-
ZStack {
|
|
322
|
-
ContentView() // your app's tabs / nav
|
|
323
|
-
if hasIncomingCall {
|
|
324
|
-
CometChatIncomingCallView()
|
|
325
|
-
.ignoresSafeArea()
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
// flip `hasIncomingCall` from your CometChatCallDelegate.onIncomingCallReceived (see §1.1a)
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
```swift
|
|
334
|
-
// UIKit host
|
|
335
|
-
class RootViewController: UIViewController {
|
|
336
|
-
override func viewDidLoad() {
|
|
337
|
-
super.viewDidLoad()
|
|
338
|
-
// Install the kit's incoming-call VC above all other view controllers
|
|
339
|
-
let incoming = CometChatIncomingCall()
|
|
340
|
-
addChild(incoming)
|
|
341
|
-
view.addSubview(incoming.view)
|
|
342
|
-
incoming.view.frame = view.bounds
|
|
343
|
-
incoming.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
344
|
-
incoming.didMove(toParent: self)
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
Mounting at the root (above your nav / tab structure) means foreground rings work app-wide — same idea as the web skill's "mount above the route boundary" rule. CallKit still handles backgrounded/terminated rings; the kit's incoming-call VC handles foreground rings. Together they're the complete foreground-and-background coverage.
|
|
350
|
-
|
|
351
|
-
If the developer DOES want a custom UI: tell them to (a) implement `CometChatCallDelegate.onIncomingCallReceived` to drive their own SwiftUI/UIKit screen, (b) call `CometChat.acceptCall` / `rejectCall` from that screen, and (c) on accept, follow the `generateToken` → `startSession` recipe in §1.1a. The kit's default UI is the recommended starting point because it already wires accept/reject/timer/profile-pic; replicating it from scratch is a 200-line side quest.
|
|
352
|
-
|
|
353
|
-
---
|
|
354
|
-
|
|
355
|
-
## 2. Setup
|
|
356
|
-
|
|
357
|
-
### Swift Package Manager (preferred)
|
|
358
|
-
|
|
359
|
-
Add via Xcode → File → Add Package Dependencies:
|
|
360
|
-
|
|
361
|
-
```
|
|
362
|
-
https://github.com/cometchat/calls-sdk-ios.git
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
Pin to `5.0.0..<6.0.0`. SPM resolves `CometChatSDK` automatically.
|
|
366
|
-
|
|
367
|
-
### CocoaPods
|
|
368
|
-
|
|
369
|
-
```ruby
|
|
370
|
-
platform :ios, '13.0'
|
|
371
|
-
target 'YourApp' do
|
|
372
|
-
use_frameworks!
|
|
373
|
-
pod 'CometChatSDK', '~> 4.0' # signaling
|
|
374
|
-
pod 'CometChatCallsSDK', '~> 5.0' # WebRTC session
|
|
375
|
-
# additive mode also has CometChatUIKitSwift '~> 5.1' already
|
|
376
|
-
end
|
|
377
|
-
|
|
378
|
-
post_install do |installer|
|
|
379
|
-
installer.pods_project.build_configurations.each do |config|
|
|
380
|
-
config.build_settings['ENABLE_USER_SCRIPT_SANDBOXING'] = 'NO' # Xcode 15+
|
|
381
|
-
end
|
|
382
|
-
end
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
### Init
|
|
386
|
-
|
|
387
|
-
In SwiftUI app entry (`@main struct App.init()`) or UIKit `application(_:didFinishLaunchingWithOptions:)`:
|
|
388
|
-
|
|
389
|
-
```swift
|
|
390
|
-
import CometChatSDK
|
|
391
|
-
import CometChatCallsSDK
|
|
392
|
-
|
|
393
|
-
let appSettings = AppSettings.AppSettingsBuilder()
|
|
394
|
-
.subscribePresenceForAllUsers()
|
|
395
|
-
.setRegion(region: Secrets.cometchatRegion)
|
|
396
|
-
.build()
|
|
397
|
-
|
|
398
|
-
CometChat.init(appId: Secrets.cometchatAppID, appSettings: appSettings) { isInitialized, error in
|
|
399
|
-
guard error == nil else { return }
|
|
400
|
-
|
|
401
|
-
let callAppSettings = CallAppSettingsBuilder()
|
|
402
|
-
.setAppId(Secrets.cometchatAppID)
|
|
403
|
-
.setRegion(Secrets.cometchatRegion)
|
|
404
|
-
.build()
|
|
405
|
-
|
|
406
|
-
CometChatCalls.init(callsAppSettings: callAppSettings, onSuccess: { _ in
|
|
407
|
-
// ready — register PushKit (rule 1.2) and CXProvider (rule 1.7) here
|
|
408
|
-
}, onError: { error in
|
|
409
|
-
print("CometChatCalls.init failed: \(error?.errorDescription ?? "")")
|
|
410
|
-
})
|
|
411
|
-
}
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
Credentials via `Secrets.swift` (gitignored) or `.xcconfig` Build Settings — see `cometchat-ios-core`.
|
|
415
|
-
|
|
416
|
-
---
|
|
417
|
-
|
|
418
|
-
## 3. Components catalog
|
|
419
|
-
|
|
420
|
-
### Calls SDK primitives (used in standalone or wherever you build custom UI)
|
|
421
|
-
|
|
422
|
-
| Type | Purpose |
|
|
423
|
-
|---|---|
|
|
424
|
-
| `CometChatCalls` | Top-level facade — `init`, `generateToken`, `startSession`, `endSession`, `audioMuted(_:)`, `videoPaused(_:)`, `switchCamera`, `enterPIPMode`/`exitPIPMode`, `startRecording`/`stopRecording`, `addCallEventListener` |
|
|
425
|
-
| `CallSettingsBuilder` | Per-session config (audio-only, presenter, hide buttons, start muted, `setDelegate`) → `.build()` returns `CallSettings` |
|
|
426
|
-
| `CallSettings` | The built per-session config passed to `startSession(callToken:callSetting:view:)` (there is no `CallSession` object in 5.x — `startSession` returns a session-id `String`) |
|
|
427
|
-
| `CallType` | `.video` / `.audio` / `.audioVideo` (swiftinterface:294-297) — there is NO `.voice` |
|
|
428
|
-
| `DisplayModes` (enum) | `.default` / `.single` / `.spotlight` (swiftinterface:175) — passed to `CallSettingsBuilder.setMode(_:)`. The current setter is `setMode(_ value: DisplayModes)` (swiftinterface:281); the `setMode(_ value: NSString)` string overload (swiftinterface:280) is DEPRECATED. There is no `LayoutMode`/`.tile`/`.sidebar` |
|
|
429
|
-
| `CallLogsRequest` + `CallLogsBuilder` | Paginated call history (note the plural — there is no `CallLogRequest`/`CallLogRequestBuilder`) |
|
|
430
|
-
| `CallsEventsDelegate` (protocol) | Lifecycle + media + participant + button events — set via `CallSettingsBuilder.setDelegate(_:)` or `CometChatCalls.addCallEventListener(observerId:delegate:)`. (NOT `CometChatCallsEventsListener` — that name doesn't exist.) |
|
|
431
|
-
|
|
432
|
-
### UI Kit views (additive mode — `CometChatUIKitSwift`)
|
|
433
|
-
|
|
434
|
-
| View / VC | Purpose |
|
|
58
|
+
## The five components
|
|
59
|
+
| Component | Role |
|
|
435
60
|
|---|---|
|
|
436
|
-
| `CometChatCallButtons` | Voice
|
|
437
|
-
| `CometChatIncomingCall` (
|
|
438
|
-
| `
|
|
439
|
-
| `
|
|
440
|
-
| `CometChatCallLogs`
|
|
441
|
-
|
|
442
|
-
|
|
61
|
+
| `CometChatCallButtons` | Voice/video triggers. **Has NO no-arg init — construct it as `CometChatCallButtons(width:height:)`.** `set(user:)` **or** `set(group:)`, plus `set(controller:)`. Put it in the message header's slot, not beside it. |
|
|
62
|
+
| `CometChatIncomingCall` | The ringing screen. `set(call:)`, `set(onAcceptClick:)`, `set(onCancelClick:)` — **decline is `onCancelClick`, there is no `onDeclineClick`.** |
|
|
63
|
+
| `CometChatOngoingCall` | The in-call surface. `set(sessionId:)` — **lowercase `d`**; `set(sessionID:)` does not compile. Also `set(callSettingsBuilder:)`, `set(callWorkFlow:)`. |
|
|
64
|
+
| `CometChatOutgoingCall` | The caller's ringing screen while the other side has not answered. `set(call:)`, `set(onCancelClick:)`. |
|
|
65
|
+
| `CometChatCallLogs` | Call history. See the `Any` warning below — this component is the worst offender. |
|
|
66
|
+
|
|
67
|
+
> **`CometChatCallLogs` callbacks are `Any`-typed — cast before touching anything.** Unlike every other list component, five of its setters hand back untyped values and will not compile if you use them directly:
|
|
68
|
+
> `set(onItemClick:)` → `(_ callLog: Any)` · `set(onCallButtonClicked:)` → `(Any)` · `set(options:)` → `(_ callLog: Any)` · `set(onLoad:)` → `([Any])` · **`set(onError:)` → `(_ error: Any)`**, not `CometChatException` like everywhere else.
|
|
69
|
+
> ```swift
|
|
70
|
+
> logs.set(onItemClick: { callLog in
|
|
71
|
+
> guard let log = callLog as? CallLog else { return } // NOT `as? Call` — that cast FAILS at
|
|
72
|
+
> … // runtime and makes the tap a silent no-op (measured: RUNTIME TYPE = CallLog).
|
|
73
|
+
> // CallLog exposes status, type, mode, initiator, receiver — not the Call spellings
|
|
74
|
+
> // (callStatus/callType/callInitiator/callReceiver). CallLog is a Calls-SDK type.
|
|
75
|
+
> })
|
|
76
|
+
> logs.set(onError: { error in
|
|
77
|
+
> // The value is the CALLS SDK's exception type — casting to the chat SDK's
|
|
78
|
+
> // CometChatException fails and prints nothing useful (measured).
|
|
79
|
+
> debugPrint((error as? CometChatCallException)?.errorDescription ?? "\(error)")
|
|
80
|
+
> })
|
|
81
|
+
> ```
|
|
82
|
+
|
|
83
|
+
> **`sessionID` vs `sessionId` — the same concept, spelled two ways.** The SDK's `Call` exposes **`sessionID`** (capital), while the kit's `CometChatOngoingCall` takes **`set(sessionId:)`** (lowercase). Reading a log and starting a call in the same function means using both spellings; neither compiles in the other's place.
|
|
84
|
+
|
|
85
|
+
Voice/video click handlers on `CometChatCallButtons` are **properties**: `callButtons.onVoiceCallClick = { user, group in … }`, `onVideoCallClick` likewise. And it is `set(callSettingsBuilder:)` — **plural "Settings"**.
|
|
86
|
+
|
|
87
|
+
> **`@MainActor` if you construct these in a factory.** Inside a `UIViewController` this wiring is free (already main-actor). But if you wrap it in a standalone factory/enum/`static` method, mark that context `@MainActor` — the components' setters are main-actor-isolated. **`CometChatOutgoingCall` is the strictest:** unlike `CometChatIncomingCall`/`CometChatCallButtons` it carries no `@preconcurrency`, so under Swift 5 its `set(call:)`/`set(onCancelClick:)` are a HARD ERROR from a nonisolated context ("call to main actor-isolated instance method … in a synchronous nonisolated context"), not just a warning. (Same rule as `cometchat-ios-core`'s `@MainActor`-factory note.)
|
|
443
88
|
|
|
444
89
|
```swift
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
90
|
+
// Minimum voice-video-calls wiring — all five components (inside a @MainActor context, e.g. a UIViewController)
|
|
91
|
+
let callButtons = CometChatCallButtons(width: 180, height: 40)
|
|
92
|
+
callButtons.set(user: user) // or .set(group:) for a group call
|
|
93
|
+
callButtons.set(controller: self)
|
|
94
|
+
callButtons.onVoiceCallClick = { user, group in /* initiate voice call */ }
|
|
95
|
+
callButtons.onVideoCallClick = { user, group in /* initiate video call */ }
|
|
96
|
+
|
|
97
|
+
// Present incoming call over any screen via a global app-level listener
|
|
98
|
+
let incoming = CometChatIncomingCall()
|
|
99
|
+
incoming.set(call: incomingCall)
|
|
100
|
+
// accept/cancel closures are TWO-arg: (call: Call?, controller: UIViewController?). A one-arg
|
|
101
|
+
// `{ call in … }` does NOT compile ("expects 2 arguments, but 1 was used").
|
|
102
|
+
incoming.set(onAcceptClick: { call, _ in /* push CometChatOngoingCall */ })
|
|
103
|
+
incoming.set(onCancelClick: { call, _ in self.dismiss(animated: true) })
|
|
104
|
+
|
|
105
|
+
let outgoing = CometChatOutgoingCall()
|
|
106
|
+
outgoing.set(call: pendingCall)
|
|
107
|
+
outgoing.set(onCancelClick: { call, _ in self.dismiss(animated: true) })
|
|
108
|
+
|
|
109
|
+
let ongoing = CometChatOngoingCall()
|
|
110
|
+
// `Call.sessionID` (uppercase D, SDK) is OPTIONAL (String?); `set(sessionId:)` (lowercase d, kit)
|
|
111
|
+
// wants a non-optional String — so GUARD it. Passing the optional directly does not compile.
|
|
112
|
+
if let sid = pendingCall.sessionID { ongoing.set(sessionId: sid) }
|
|
113
|
+
|
|
114
|
+
let logs = CometChatCallLogs()
|
|
115
|
+
// NOTE: CometChatCallLogs has NO `set(controller:)` — present/push it like any UIViewController
|
|
116
|
+
// (e.g. UINavigationController(rootViewController: logs)). Its only setters are the Any-typed
|
|
117
|
+
// callbacks below plus set(callRequestBuilder:).
|
|
118
|
+
logs.set(onItemClick: { callLog in guard let log = callLog as? CallLog else { return } /* … */ })
|
|
449
119
|
```
|
|
450
120
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
## 4. Standalone integration
|
|
454
|
-
|
|
455
|
-
When `product === "voice-video"` and there is no existing UI Kit.
|
|
456
|
-
|
|
457
|
-
**Split by calling mode:**
|
|
458
|
-
|
|
459
|
-
### 4a. Standalone — Session mode (meeting-room UX, no ringing)
|
|
460
|
-
|
|
461
|
-
Calls SDK ONLY. NO Chat SDK, NO CallKit, NO PushKit. Matches `calls-sdk-ios-5/sample-apps/cometchat-calls-sample-app-ios/`. Scaffold:
|
|
462
|
-
|
|
463
|
-
1. **App entry** — `CometChatCalls.init(callsAppSettings:)` with a `CallAppSettingsBuilder().setAppId(...).setRegion(...).build()` ONLY. No `CometChat.init`, no `CometChat.login`, no PushKit, no CallKit.
|
|
464
|
-
2. **`JoinSessionView.swift`** — UID picker + "Start meeting" / "Join meeting" + state.
|
|
465
|
-
3. **`CallView.swift` + `CallContainerView: UIViewRepresentable`** — `CometChatCalls.generateToken(authToken:sessionID:)` then `CometChatCalls.startSession(callToken:callSetting:view:)`. Coordinator conforms to `CallsEventsDelegate` (set via `CallSettingsBuilder.setDelegate`). See `references/call-session.md`.
|
|
466
|
-
4. **`Info.plist` patch** — Camera + microphone permissions ONLY. No `audio` or `voip` Background Modes needed.
|
|
467
|
-
5. **Universal Link routing** — meeting URL → CallView.
|
|
468
|
-
|
|
469
|
-
**Why no CallKit / no PushKit:** session mode is link-driven, not push-driven. No incoming ring to surface.
|
|
470
|
-
|
|
471
|
-
### 4b. Standalone — Ringing mode (CallKit + PushKit + Chat SDK signaling)
|
|
472
|
-
|
|
473
|
-
Dual-SDK + CallKit + PushKit. Scaffold:
|
|
474
|
-
|
|
475
|
-
1. **App entry** — Chat SDK + Calls SDK init, PushKit + CallKit registration (rule 1.2, 1.7).
|
|
476
|
-
2. **`CallKitProviderDelegate.swift`** — `CXProviderDelegate` implementation. Routes `CXAnswerCallAction` → `CometChatCalls.generateToken` then `startSession(callToken:callSetting:view:)`. Routes `CXEndCallAction` → `CometChatCalls.endSession()` + `AVAudioSession` cleanup (rule 1.5).
|
|
477
|
-
3. **`PushRegistryDelegate.swift`** — `PKPushRegistryDelegate` listening on `.voIP`. On payload → `CXProvider.reportNewIncomingCall` immediately.
|
|
478
|
-
4. **`ProfileView.swift` (SwiftUI) or `ProfileViewController.swift` (UIKit)** — Hosts call buttons next to user info. Tap → `CometChat.initiateCall`.
|
|
479
|
-
5. **`OngoingCallView.swift`** — Custom view hosting the SDK's call surface via `UIViewRepresentable` bridging. Implements rule 1.5 teardown.
|
|
480
|
-
6. **`CallLogsView.swift`** — `/calls` equivalent — `CallLogsRequest.CallLogsBuilder`.
|
|
481
|
-
7. **`Info.plist` patch** — Background Modes (rule 1.3), permissions (rule 1.6).
|
|
482
|
-
8. **VoIP Services certificate setup** — manual step (Apple Developer portal + App Store Connect). The skill documents the steps; cannot automate.
|
|
483
|
-
|
|
484
|
-
## 5. Additive integration
|
|
485
|
-
|
|
486
|
-
When `cometchat-ios` is already integrated.
|
|
487
|
-
|
|
488
|
-
> ✅ **Kit-default path FIRST (what the canonical `SampleApp` actually does).** `CometChatCallsSDK` is **vendored inside `CometChatUIKitSwift`** — no separate SPM/Pod add, and **no separate `CometChatCalls.init`**. The sample turns calling on with **`UIKitSettings…enable(inAppIncomingCall: true)`** at init (`SampleApp/SceneDelegate.swift`), then just drops in `CometChatCallButtons(...).set(user:)` (e.g. in the user-details screen) and a `CometChatCallLogs` tab — the kit handles `generateToken`/`startSession` and the incoming-call UI internally. You do NOT hand-write `CometChatCalls.init` + a manual `generateToken → startSession` flow on this path. (The manual two-step is the **standalone / custom-UI** path only — §1.1 / §4.)
|
|
489
|
-
|
|
490
|
-
The kit-default additive recipe:
|
|
491
|
-
1. Confirm `CometChatUIKitSwift` is present (CallsSDK is bundled — nothing extra to install).
|
|
492
|
-
2. Set **`.enable(inAppIncomingCall: true)`** on the `UIKitSettings` builder at init (the one calling switch).
|
|
493
|
-
3. Add Background Modes (`voip`, `remote-notification`, `audio`) + camera/mic permissions to `Info.plist`.
|
|
494
|
-
4. Drop in `CometChatCallButtons` (e.g. user-details / contact screen) — the kit also auto-renders them in `CometChatMessageHeader` when CallsSDK is present; add `CometChatCallLogs` as a tab/route.
|
|
495
|
-
5. (Optional) CallKit + PushKit for background VoIP (asks user — same opt-in as Android).
|
|
496
|
-
|
|
497
|
-
Only reach for `CometChatCalls.init` + `generateToken`/`startSession` (§1.1) when building a **custom call surface** without the kit's call components.
|
|
498
|
-
|
|
499
|
-
## 6. Anti-patterns
|
|
500
|
-
|
|
501
|
-
1. **Skipping CallKit + PushKit** in standalone mode. The app cannot ring backgrounded/terminated devices any other way. App Store reviewers test this.
|
|
502
|
-
2. **Calling `CXProvider.reportNewIncomingCall` after async work.** Apple terminates the app process if the report happens more than ~5 seconds after PushKit delivery. Report immediately, then do the actual `generateToken` + `startSession` from inside `CXAnswerCallAction`.
|
|
503
|
-
3. **Forgetting `setActive(false, options: .notifyOthersOnDeactivation)`** on hangup. Music/phone-call audio sounds wrong until the next foreground. The "looks fine in dev, fails review" bug.
|
|
504
|
-
4. **Declaring `voip` in `UIBackgroundModes` without using PushKit.** Apple rejects.
|
|
505
|
-
5. **Mixing CallKit and an in-app incoming-call screen** in standalone mode. Causes double-rings and confused state. CallKit owns standalone rings; in-app UI is additive-mode only.
|
|
506
|
-
6. **Using SwiftUI `.alert` for incoming calls.** It only fires when the app is foregrounded. Use CallKit (rule 1.7).
|
|
507
|
-
7. **Pinning `CometChatCallsSDK` to a `4.x`** because that's what the chat SDK is on. They version independently — Calls SDK 5.x is the current calls major.
|
|
508
|
-
|
|
509
|
-
## 7. Verification checklist
|
|
510
|
-
|
|
511
|
-
**Static:**
|
|
512
|
-
|
|
513
|
-
- [ ] `CometChatCallsSDK` in SPM Package.resolved or Podfile.lock
|
|
514
|
-
- [ ] `CometChat.init` followed by `CometChatCalls.init` in app entry
|
|
515
|
-
- [ ] PushKit registry listening on `.voIP`
|
|
516
|
-
- [ ] `CXProvider` configured with `CXProviderConfiguration` (app name + ringtone if any)
|
|
517
|
-
- [ ] `CXProviderDelegate` implements answer + end actions
|
|
518
|
-
- [ ] `Info.plist` has `NSMicrophoneUsageDescription` + `NSCameraUsageDescription`
|
|
519
|
-
- [ ] `Info.plist` `UIBackgroundModes` has `audio` + `voip` + `remote-notification`
|
|
520
|
-
- [ ] Hangup path includes `endSession` + `setActive(false, options: .notifyOthersOnDeactivation)` + `cxProvider.reportCall(...endedAt:reason:)`
|
|
521
|
-
- [ ] **Standalone only:** No in-app incoming-call screen — CallKit owns it
|
|
522
|
-
|
|
523
|
-
**Runtime (real device):**
|
|
121
|
+
## Incoming calls are app-level, not screen-level
|
|
122
|
+
A call can arrive on any screen, so listen at the app level (`CometChatCallEventListener` / `CometChatCallEvents`) and present `CometChatIncomingCall` over whatever is showing. Wiring it inside one chat screen means calls are missed everywhere else.
|
|
524
123
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
- [ ] Tap "Answer" on lock screen → app opens directly into ongoing call
|
|
528
|
-
- [ ] Hangup ends call, camera light off, music resumes if it was playing
|
|
529
|
-
- [ ] Background the app during a call → audio continues
|
|
530
|
-
- [ ] Lock device during a call → ongoing-call UI on lock screen, audio continues
|
|
124
|
+
## Permissions and background
|
|
125
|
+
Camera and microphone usage descriptions in `Info.plist`, or the app crashes on first call rather than failing gracefully. Ringing while backgrounded is handled by the **`CometChatPushNotifications`** SDK — it owns CallKit + PushKit for you. **Do NOT hand-roll `PKPushRegistryDelegate` / `CXProviderDelegate` or call `UIKitSettings.set(voipToken:)`** (that setter is the legacy path the current docs no longer use). Full VoIP wiring: `cometchat-ios-v5-sdk` § "VoIP call notifications" and `cometchat-ios-push`; needs an APNs VoIP provider in the Dashboard and a physical device.
|
|
531
126
|
|
|
532
|
-
##
|
|
127
|
+
## Gotchas
|
|
128
|
+
- **Simulator limits.** No camera; a WebRTC surface may behave differently than on device. Verify calling on a real device.
|
|
129
|
+
- **Every call screen needs an exit.** Accept, decline and hang-up must all lead somewhere.
|
|
130
|
+
- **Version lock.** Kit 5.1.22 / SDK 4.1.7 / Calls 5.0.3 are exact; mixing versions fails to build or crashes at runtime.
|
|
533
131
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
- `cometchat-ios-components` — full UI Kit catalog (additive mode)
|
|
537
|
-
- `cometchat-ios-push` — APNs setup; some overlap with PushKit but distinct (PushKit is VoIP-only)
|
|
538
|
-
- `cometchat-ios-production` — server-minted tokens, security checklist
|
|
539
|
-
- `cometchat-ios-troubleshooting` — common failure modes (PushKit delivery, CallKit reporting timing, ENABLE_USER_SCRIPT_SANDBOXING)
|
|
132
|
+
## Verify it works
|
|
133
|
+
On a device: the call button appears in the header, tapping it rings the other side, the incoming screen shows over whatever was on screen, accept connects with audio and video, hang-up releases camera and microphone, and the call appears in call logs.
|