@cometchat/skills 4.4.2 → 5.0.1
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 +44 -0
- package/LICENSE +21 -0
- package/MIGRATING.md +187 -0
- package/README.md +52 -156
- package/RULES.md +125 -0
- package/bin/cometchat-skills.mjs +1280 -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 +156 -74
- package/peers.yaml +355 -0
- package/registry/README.md +31 -0
- package/registry/android-calls-v5.json +94 -0
- package/registry/android-v6.json +177 -0
- package/registry/angular-v5.json +154 -0
- package/registry/flutter-calls-v5.json +94 -0
- package/registry/flutter-v6.json +159 -0
- package/registry/ios-calls-v5.json +99 -0
- package/registry/ios-v5.json +152 -0
- package/registry/rn-calls-v5.json +99 -0
- package/registry/rn-v5.json +169 -0
- package/registry/sdk-android-v5.json +93 -0
- package/registry/sdk-jsv4.json +93 -0
- package/registry/web-calls-v5.json +94 -0
- package/registry/web-v7.json +154 -0
- package/skills/cometchat/SKILL.md +47 -2096
- package/skills/cometchat-a11y/SKILL.md +44 -472
- package/skills/cometchat-analytics/SKILL.md +61 -0
- 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 -413
- 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 +41 -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 +102 -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-audit/SKILL.md +61 -0
- package/skills/cometchat-compliance/SKILL.md +63 -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 -389
- 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 +132 -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 +59 -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-i18n/SKILL.md +35 -404
- package/skills/cometchat-ios-calls/SKILL.md +112 -563
- package/skills/cometchat-ios-components/SKILL.md +44 -834
- package/skills/cometchat-ios-core/SKILL.md +182 -1068
- package/skills/cometchat-ios-core/references/anti-patterns.md +113 -0
- package/skills/cometchat-ios-core/references/docs-map.md +124 -0
- package/skills/cometchat-ios-core/references/install.md +23 -0
- package/skills/cometchat-ios-core/references/layout.md +219 -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-production/SKILL.md +67 -723
- package/skills/cometchat-ios-push/SKILL.md +24 -602
- package/skills/cometchat-ios-testing/SKILL.md +36 -355
- package/skills/cometchat-ios-troubleshooting/SKILL.md +31 -989
- 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-migrate-from-getstream/SKILL.md +65 -0
- package/skills/cometchat-migrate-from-getstream/references/concept-map.md +98 -0
- package/skills/cometchat-migrate-from-getstream/references/data-migration.md +74 -0
- package/skills/cometchat-migrate-from-getstream/references/feature-map.md +108 -0
- package/skills/cometchat-migrate-from-getstream/references/inventory.md +82 -0
- package/skills/cometchat-migrate-from-getstream/references/native-build.md +9 -0
- package/skills/cometchat-migrate-from-getstream/references/report-template.md +59 -0
- package/skills/cometchat-migrate-from-sendbird/SKILL.md +64 -0
- package/skills/cometchat-migrate-from-sendbird/references/concept-map.md +99 -0
- package/skills/cometchat-migrate-from-sendbird/references/data-migration.md +74 -0
- package/skills/cometchat-migrate-from-sendbird/references/feature-map.md +104 -0
- package/skills/cometchat-migrate-from-sendbird/references/inventory.md +86 -0
- package/skills/cometchat-migrate-from-sendbird/references/native-build.md +10 -0
- package/skills/cometchat-migrate-from-sendbird/references/report-template.md +59 -0
- package/skills/cometchat-migrate-from-twilio/SKILL.md +52 -0
- package/skills/cometchat-migrate-from-twilio/references/concept-map.md +49 -0
- package/skills/cometchat-migrate-from-twilio/references/data-migration.md +50 -0
- package/skills/cometchat-migrate-from-twilio/references/feature-map.md +27 -0
- package/skills/cometchat-migrate-from-twilio/references/inventory.md +53 -0
- package/skills/cometchat-migrate-from-twilio/references/report-template.md +52 -0
- package/skills/cometchat-moderation/SKILL.md +58 -0
- package/skills/cometchat-onboarding/SKILL.md +92 -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 +105 -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 +335 -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 +127 -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 +79 -0
- package/skills/cometchat-react-native-push/SKILL.md +88 -0
- package/skills/cometchat-react-native-sdk/SKILL.md +133 -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 +174 -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/layout.md +150 -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-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-production/SKILL.md +84 -0
- package/skills/cometchat-react-v7-push/SKILL.md +53 -0
- package/skills/cometchat-react-v7-testing/SKILL.md +60 -0
- package/skills/cometchat-react-v7-troubleshooting/SKILL.md +47 -0
- package/skills/cometchat-security/SKILL.md +80 -0
- package/skills/cometchat-self-host/SKILL.md +56 -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 +932 -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 +134 -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-android-v5/SKILL.md +0 -121
- package/skills/cometchat-android-v5-calls/SKILL.md +0 -429
- 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 -380
- 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 -455
- 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-ios/SKILL.md +0 -325
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +0 -181
- 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-theming/SKILL.md +0 -667
- package/skills/cometchat-native-bare-patterns/SKILL.md +0 -550
- package/skills/cometchat-native-calls/SKILL.md +0 -671
- 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 -752
- 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,584 +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` — **in 5.0.1 and earlier; 5.0.2 restores them — see the §1.0 correction**). 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) — CORRECTED for 5.0.2 (2026-07-21)
|
|
46
|
-
|
|
47
|
-
> **Correction (ENG-37137, verified against the published 5.0.2 binary + live end-to-end test 2026-07-21):** the "no login" claim below is TRUE for the UI Kit-vendored calls framework and for standalone **5.0.1 and earlier**, but **standalone `CometChatCallsSDK` 5.0.2 exports `login(UID:authKey:)` / `login(UID:apiKey:)` / `login(authToken:)` / `logout()` and persists the session** (v4-compat surface restored in `calls-core`; the SDK's own sample app logs in via `LoginViewController`). This matters for two reasons: (a) after login, the `generateToken(sessionID:)` overload works without hand-passing an auth token; (b) **login success is the trigger for the ai-agent identification telemetry** (§2) — in a calls-only app that never logs in, the self-report has nothing to fire on. Dual-SDK (ringing) integrations are unaffected: the Chat SDK login remains the only login you need there.
|
|
48
|
-
|
|
49
|
-
Unlike the Android / Flutter / JS Calls SDKs, **`CometChatCalls` on iOS has no `login()` and no `getLoggedInUser()`** — those methods do not exist in `CometChatCallsSDK` 5.0.1 and earlier (see correction above for 5.0.2+). 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).
|
|
50
|
-
|
|
51
|
-
```swift
|
|
52
|
-
import CometChatSDK
|
|
53
|
-
import CometChatCallsSDK
|
|
54
|
-
|
|
55
|
-
// Chat SDK login is the ONLY login. (UI Kit users: CometChatUIKit.login already did this.)
|
|
56
|
-
CometChat.login(UID: uid, authKey: AUTH_KEY) { user in
|
|
57
|
-
// Chat SDK ready. No CometChatCalls.login() exists — do NOT call it.
|
|
58
|
-
// The incoming-call listener can be registered now; per-call auth happens via generateToken.
|
|
59
|
-
} onError: { error in
|
|
60
|
-
// chat login failed
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Dev: the auth token for generateToken comes from the Chat SDK:
|
|
64
|
-
let authToken = CometChat.getUserAuthToken() // String? — pass to generateToken(authToken:)
|
|
65
|
-
// Production: fetch a fresh server-minted token from your backend instead.
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
**Surprises:**
|
|
69
|
-
- 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`.
|
|
70
|
-
- `generateToken` / `startSession` errors hit the `onError` closure (not `do/try/catch`). The error type is `CometChatCallException` — has `errorDescription` and `errorCode`.
|
|
71
|
-
|
|
72
|
-
### 1.1 Dual-SDK contract
|
|
73
|
-
|
|
74
|
-
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:
|
|
75
|
-
|
|
76
|
-
```swift
|
|
77
|
-
// ✓ RIGHT — initiate ringing (Chat SDK)
|
|
78
|
-
import CometChatSDK
|
|
79
|
-
|
|
80
|
-
let outgoing = Call(receiverId: receiverUid, callType: .video, receiverType: .user)
|
|
81
|
-
CometChat.initiateCall(call: outgoing, onSuccess: { initiated in
|
|
82
|
-
// initiated.sessionID is what the Calls SDK will join
|
|
83
|
-
}, onError: { error in
|
|
84
|
-
// surface to UI
|
|
85
|
-
})
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
```swift
|
|
89
|
-
// ✓ RIGHT — start the WebRTC session (Calls SDK 5.x) after acceptance.
|
|
90
|
-
// iOS Calls SDK 5.x is a TWO-STEP flow: generateToken → startSession.
|
|
91
|
-
// There is NO joinSession, NO CallSession singleton, and NO SessionSettingsBuilder
|
|
92
|
-
// in the 5.x SDK — those are phantom. The real builder is CallSettingsBuilder.
|
|
93
|
-
// - CallSettingsBuilder (NOT SessionSettingsBuilder) builds the CallSettings
|
|
94
|
-
// - generateToken(authToken:sessionID:) FIRST, then startSession(callToken:callSetting:view:)
|
|
95
|
-
// - Attach the event listener via CallSettingsBuilder.setDelegate(_:) (CallsEventsDelegate)
|
|
96
|
-
import CometChatCallsSDK
|
|
97
|
-
|
|
98
|
-
let settings = CallSettingsBuilder()
|
|
99
|
-
.setStartVideoMuted(false)
|
|
100
|
-
.setStartAudioMuted(false)
|
|
101
|
-
.setDelegate(callListener) // any CallsEventsDelegate — onCallEnded, onUserJoined, …
|
|
102
|
-
.build()
|
|
103
|
-
|
|
104
|
-
// loggedInAuthToken: the current user's auth token — CometChat.getUserAuthToken()
|
|
105
|
-
// (User has NO .authToken property; getUserAuthToken() is the real accessor)
|
|
106
|
-
CometChatCalls.generateToken(authToken: loggedInAuthToken, sessionID: sessionID) { callToken in
|
|
107
|
-
guard let callToken = callToken else { return }
|
|
108
|
-
CometChatCalls.startSession(
|
|
109
|
-
callToken: callToken,
|
|
110
|
-
callSetting: settings,
|
|
111
|
-
view: callContainerView // UIView with measurable bounds
|
|
112
|
-
) { _ in
|
|
113
|
-
// session started — the call UI is rendered into callContainerView
|
|
114
|
-
} onError: { error in
|
|
115
|
-
print("startSession failed: \(error?.errorDescription ?? "unknown")")
|
|
116
|
-
}
|
|
117
|
-
} onError: { error in
|
|
118
|
-
print("generateToken failed: \(error?.errorDescription ?? "unknown")")
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### 1.1a End-to-end initiate→join sequence (ENG-35710)
|
|
123
|
-
|
|
124
|
-
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.
|
|
125
|
-
|
|
126
|
-
> **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.
|
|
127
|
-
|
|
128
|
-
```swift
|
|
129
|
-
// Step A: register the listener on app start (before any call fires)
|
|
130
|
-
// Listener ID is a String; listener instance is "self" or any class conforming
|
|
131
|
-
// to CometChatCallDelegate.
|
|
132
|
-
CometChat.addCallListener(callListenerID, self)
|
|
133
|
-
|
|
134
|
-
// Step B: conform to CometChatCallDelegate (NOT CometChatCallsListener)
|
|
135
|
-
extension YourClass: CometChatCallDelegate {
|
|
136
|
-
// Caller side: the OTHER party accepted — NOW join the session
|
|
137
|
-
func onOutgoingCallAccepted(acceptedCall: Call?, error: CometChatException?) {
|
|
138
|
-
if let error = error { /* surface */ return }
|
|
139
|
-
guard let call = acceptedCall, let sessionID = call.sessionID else { return }
|
|
140
|
-
startCallSession(sessionID: sessionID)
|
|
141
|
-
}
|
|
142
|
-
// Receiver side: incoming call rang — present accept UI; on accept, start the session
|
|
143
|
-
func onIncomingCallReceived(incomingCall: Call?, error: CometChatException?) {
|
|
144
|
-
if let error = error { /* surface */ return }
|
|
145
|
-
guard let call = incomingCall else { return }
|
|
146
|
-
presentIncomingCallUI(for: call) { accepted in
|
|
147
|
-
if accepted {
|
|
148
|
-
CometChat.acceptCall(sessionID: call.sessionID ?? "") { acceptedCall in
|
|
149
|
-
self.startCallSession(sessionID: acceptedCall?.sessionID ?? "")
|
|
150
|
-
} onError: { _ in /* surface */ }
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
func onOutgoingCallRejected(rejectedCall: Call?, error: CometChatException?) { /* end UI, cleanup */ }
|
|
155
|
-
func onIncomingCallCancelled(canceledCall: Call?, error: CometChatException?) { /* dismiss incoming UI — label is canceledCall: (single L) */ }
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Don't forget to remove the listener on teardown
|
|
159
|
-
// CometChat.removeCallListener(callListenerID)
|
|
160
|
-
|
|
161
|
-
// Step B: kick the call off (caller — your "Call" button taps this)
|
|
162
|
-
let outgoing = Call(receiverId: targetUid, callType: .video, receiverType: .user)
|
|
163
|
-
CometChat.initiateCall(call: outgoing, onSuccess: { initiated in
|
|
164
|
-
// initiated.sessionID is what the session will use — but DO NOT start the
|
|
165
|
-
// session here. Wait for onOutgoingCallAccepted on the listener. Starting before
|
|
166
|
-
// the remote accepts means you're alone in an empty session.
|
|
167
|
-
}, onError: { error in /* surface */ })
|
|
168
|
-
|
|
169
|
-
// Step C: start the session (caller in onOutgoingCallAccepted, receiver after acceptCall)
|
|
170
|
-
// 5.x flow: generateToken(authToken:sessionID:) → startSession(callToken:callSetting:view:)
|
|
171
|
-
func startCallSession(sessionID: String) {
|
|
172
|
-
let settings = CallSettingsBuilder()
|
|
173
|
-
.setStartVideoMuted(false)
|
|
174
|
-
.setStartAudioMuted(false)
|
|
175
|
-
.setDelegate(self) // self conforms to CallsEventsDelegate
|
|
176
|
-
.build()
|
|
177
|
-
CometChatCalls.generateToken(authToken: loggedInAuthToken, sessionID: sessionID) { callToken in
|
|
178
|
-
guard let callToken = callToken else { return }
|
|
179
|
-
CometChatCalls.startSession(
|
|
180
|
-
callToken: callToken,
|
|
181
|
-
callSetting: settings,
|
|
182
|
-
view: callContainerView // UIView WITH non-zero bounds (lay out first)
|
|
183
|
-
) { _ in
|
|
184
|
-
// session started
|
|
185
|
-
} onError: { error in
|
|
186
|
-
print("startSession failed: \(error?.errorDescription ?? "unknown")")
|
|
187
|
-
}
|
|
188
|
-
} onError: { error in
|
|
189
|
-
print("generateToken failed: \(error?.errorDescription ?? "unknown")")
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
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.
|
|
195
|
-
|
|
196
|
-
### 1.2 CallKit + PushKit are mandatory
|
|
197
|
-
|
|
198
|
-
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:
|
|
199
|
-
|
|
200
|
-
- **PushKit** delivers VoIP push tokens (separate from APNs tokens) and high-priority VoIP payloads even when the app is terminated
|
|
201
|
-
- **CallKit** presents the system incoming-call UI (lock-screen, even when device is locked) and reports call state to the OS
|
|
202
|
-
- Your `PKPushRegistry` listener calls `CXProvider.reportNewIncomingCall(...)` immediately on receiving the VoIP payload — Apple terminates apps that delay this
|
|
203
|
-
|
|
204
|
-
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.
|
|
205
|
-
|
|
206
|
-
### 1.3 Background modes — three required entries
|
|
207
|
-
|
|
208
|
-
In the target's "Signing & Capabilities" → Background Modes:
|
|
209
|
-
|
|
210
|
-
- **`Audio, AirPlay, and Picture in Picture`** — required for ongoing-call audio when backgrounded
|
|
211
|
-
- **`Voice over IP`** — required for PushKit VoIP payload delivery
|
|
212
|
-
- **`Remote notifications`** — required for chat push (keeps existing entitlements working)
|
|
213
|
-
|
|
214
|
-
In `Info.plist`:
|
|
215
|
-
|
|
216
|
-
```xml
|
|
217
|
-
<key>UIBackgroundModes</key>
|
|
218
|
-
<array>
|
|
219
|
-
<string>audio</string>
|
|
220
|
-
<string>voip</string>
|
|
221
|
-
<string>remote-notification</string>
|
|
222
|
-
</array>
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
Apple will reject the app if `voip` is declared but PushKit is not actually used.
|
|
226
|
-
|
|
227
|
-
### 1.4 Server-minted auth tokens
|
|
228
|
-
|
|
229
|
-
Same rule as the chat dispatcher / `cometchat-ios-production`. Production calls path uses `CometChat.login(authToken:)`, not `CometChat.login(uid:authKey:)`.
|
|
230
|
-
|
|
231
|
-
### 1.5 Hangup cleanup — `AVAudioSession` routing
|
|
232
|
-
|
|
233
|
-
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:
|
|
234
24
|
|
|
235
25
|
```swift
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// CallKit must be told the call ended, even if WE ended it
|
|
255
|
-
cxProvider.reportCall(with: callUUID, endedAt: Date(), reason: .remoteEnded)
|
|
256
|
-
}
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
In-call controls are **static funcs on `CometChatCalls`** (there is no `CallSession` type in the 5.x Calls SDK). Audio/video toggles take a `Bool`:
|
|
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") })
|
|
35
|
+
```
|
|
36
|
+
|
|
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`:
|
|
260
42
|
|
|
261
43
|
```swift
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
CometChatCalls
|
|
265
|
-
|
|
266
|
-
CometChatCalls.startRecording() // stopRecording() to end
|
|
267
|
-
// NOTE: the iOS Calls SDK 5.x has NO local screen-share initiation API
|
|
268
|
-
// (no startScreenShare/stopScreenShare) — iOS can only RECEIVE a remote
|
|
269
|
-
// participant's screen share, not start one.
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
Skipping the `setActive(false, options: .notifyOthersOnDeactivation)` is the canonical "music doesn't resume after the call" bug.
|
|
273
|
-
|
|
274
|
-
### 1.6 Permissions with rationale — Info.plist usage strings
|
|
275
|
-
|
|
276
|
-
Two required entries; iOS rejects builds that record without them:
|
|
277
|
-
|
|
278
|
-
```xml
|
|
279
|
-
<key>NSMicrophoneUsageDescription</key>
|
|
280
|
-
<string>So you can talk during voice and video calls.</string>
|
|
281
|
-
<key>NSCameraUsageDescription</key>
|
|
282
|
-
<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") })
|
|
283
48
|
```
|
|
284
49
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
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:
|
|
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.
|
|
290
53
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
In additive mode, the UI Kit's incoming-call view can be used for in-foreground rings; CallKit handles backgrounded/terminated rings.
|
|
296
|
-
|
|
297
|
-
### 1.7a Default incoming/outgoing UI fallback (ENG-35710)
|
|
298
|
-
|
|
299
|
-
Two iOS testers shipped without a foreground incoming/outgoing screen because the skill jumped straight to CallKit and never showed what to render when the app is already in-foreground. Result: a Call rings on the wire, but the user-facing app shows nothing — the call connects, the call drops, no feedback.
|
|
300
|
-
|
|
301
|
-
**If the developer hasn't asked for a custom incoming-call UI, wire the kit's defaults:**
|
|
302
|
-
|
|
303
|
-
```swift
|
|
304
|
-
// SwiftUI host
|
|
305
|
-
import SwiftUI
|
|
306
|
-
import UIKit
|
|
307
|
-
import CometChatUIKitSwift
|
|
308
|
-
|
|
309
|
-
// The kit ships call UI as UIViewControllers (CometChatIncomingCall / CometChatOutgoingCall /
|
|
310
|
-
// CometChatOngoingCall) — there are NO `…SwiftUI`-suffixed wrappers. Bridge with
|
|
311
|
-
// UIViewControllerRepresentable. Present the controller when your delegate fires (§1.1a);
|
|
312
|
-
// configure it via the kit's IncomingCallConfiguration rather than a constructor arg.
|
|
313
|
-
struct CometChatIncomingCallView: UIViewControllerRepresentable {
|
|
314
|
-
func makeUIViewController(context: Context) -> CometChatIncomingCall {
|
|
315
|
-
CometChatIncomingCall()
|
|
316
|
-
}
|
|
317
|
-
func updateUIViewController(_ vc: CometChatIncomingCall, context: Context) {}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
struct AppRootView: View {
|
|
321
|
-
@State private var hasIncomingCall = false
|
|
322
|
-
var body: some View {
|
|
323
|
-
ZStack {
|
|
324
|
-
ContentView() // your app's tabs / nav
|
|
325
|
-
if hasIncomingCall {
|
|
326
|
-
CometChatIncomingCallView()
|
|
327
|
-
.ignoresSafeArea()
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
// flip `hasIncomingCall` from your CometChatCallDelegate.onIncomingCallReceived (see §1.1a)
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
```
|
|
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).
|
|
334
57
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
class RootViewController: UIViewController {
|
|
338
|
-
override func viewDidLoad() {
|
|
339
|
-
super.viewDidLoad()
|
|
340
|
-
// Install the kit's incoming-call VC above all other view controllers
|
|
341
|
-
let incoming = CometChatIncomingCall()
|
|
342
|
-
addChild(incoming)
|
|
343
|
-
view.addSubview(incoming.view)
|
|
344
|
-
incoming.view.frame = view.bounds
|
|
345
|
-
incoming.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
346
|
-
incoming.didMove(toParent: self)
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
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.
|
|
352
|
-
|
|
353
|
-
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.
|
|
354
|
-
|
|
355
|
-
---
|
|
356
|
-
|
|
357
|
-
## 2. Setup
|
|
358
|
-
|
|
359
|
-
### Swift Package Manager (preferred)
|
|
360
|
-
|
|
361
|
-
Add via Xcode → File → Add Package Dependencies:
|
|
362
|
-
|
|
363
|
-
```
|
|
364
|
-
https://github.com/cometchat/calls-sdk-ios.git
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
Pin to `5.0.0..<6.0.0`. SPM resolves `CometChatSDK` automatically.
|
|
368
|
-
|
|
369
|
-
### CocoaPods
|
|
370
|
-
|
|
371
|
-
```ruby
|
|
372
|
-
platform :ios, '15.1' # REQUIRED for CometChatCallsSDK 5.0.2+ — a lower platform silently resolves 5.0.1 (no initFromSettings)
|
|
373
|
-
target 'YourApp' do
|
|
374
|
-
use_frameworks!
|
|
375
|
-
pod 'CometChatSDK', '~> 4.0' # signaling
|
|
376
|
-
pod 'CometChatCallsSDK', '~> 5.0' # WebRTC session
|
|
377
|
-
# additive mode also has CometChatUIKitSwift '~> 5.1' already
|
|
378
|
-
end
|
|
379
|
-
|
|
380
|
-
post_install do |installer|
|
|
381
|
-
installer.pods_project.build_configurations.each do |config|
|
|
382
|
-
config.build_settings['ENABLE_USER_SCRIPT_SANDBOXING'] = 'NO' # Xcode 15+
|
|
383
|
-
end
|
|
384
|
-
end
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
### Init — file-based with `cometchat-settings.json` (recommended)
|
|
388
|
-
|
|
389
|
-
> **Version requirement (ENG-37137 — Skills Telemetry).** `CometChatCalls.initFromSettings(onSuccess:onError:)` reads a bundled `cometchat-settings.json` and lets the **Calls SDK** self-report `integrationSource = "ai-agent"` to `/user_sessions`. It ships in **`CometChatCallsSDK` >= 5.0.2** (released 2026-07-20). ⚠️ **THE SILENT-DOWNGRADE TRAP: 5.0.2 raised the minimum iOS deployment target to 15.1.** If the Podfile declares `platform :ios` below 15.1, CocoaPods does NOT error — it silently resolves **5.0.1**, which has no `initFromSettings` (and self-reports version 99.0.0). After `pod install`, **verify `Podfile.lock` shows `CometChatCallsSDK (5.0.2)`** — a missing `initFromSettings` symbol at build time means you got 5.0.1. On 5.0.1/5.0.0 the method does not exist — bump the platform to 15.1 (preferred) or use the **`CallAppSettingsBuilder` fallback** below.
|
|
390
|
-
|
|
391
|
-
Like the iOS UI Kit's `CometChatUIKit.initFromSettings` (see `cometchat-ios-core`), the Calls variant takes **no settings argument** — it reads the file straight from the app's main bundle, so the file must be in the target's **Copy Bundle Resources**.
|
|
392
|
-
|
|
393
|
-
**Step 1 — `cometchat-settings.json`.** It is the SAME unified file the chat-side skills create. If `cometchat-ios-core` already added one, reuse it — just confirm the `callsSDK` section exists. Creating it fresh (calls-only app):
|
|
394
|
-
|
|
395
|
-
```json
|
|
396
|
-
{
|
|
397
|
-
"appId": "APP_ID_HERE",
|
|
398
|
-
"region": "us",
|
|
399
|
-
"credentials": {
|
|
400
|
-
"authKey": "AUTH_KEY_HERE"
|
|
401
|
-
},
|
|
402
|
-
"callsSDK": {
|
|
403
|
-
"host": null,
|
|
404
|
-
"adminHost": null,
|
|
405
|
-
"clientHost": null,
|
|
406
|
-
"callsHost": null
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
`initFromSettings` reads the root `appId` / `region` and the four optional `callsSDK` host overrides; everything else in the unified schema is ignored by the Calls SDK. Add the file to the app target (*File → Add Files…* AND confirm it under *Build Phases → Copy Bundle Resources*) — `SETTINGS_FILE_NOT_FOUND` at init means it's missing from Copy Bundle Resources. Commit the file; treat any `authKey` in it as a public demo credential (same rule as `cometchat-ios-core` §2).
|
|
412
|
-
|
|
413
|
-
**Step 2 — init (no builder, no args):**
|
|
414
|
-
|
|
415
|
-
```swift
|
|
416
|
-
import CometChatSDK
|
|
417
|
-
import CometChatCallsSDK
|
|
418
|
-
|
|
419
|
-
let appSettings = AppSettings.AppSettingsBuilder()
|
|
420
|
-
.subscribePresenceForAllUsers()
|
|
421
|
-
.setRegion(region: Secrets.cometchatRegion)
|
|
422
|
-
.build()
|
|
423
|
-
|
|
424
|
-
CometChat.init(appId: Secrets.cometchatAppID, appSettings: appSettings) { isInitialized, error in
|
|
425
|
-
guard error == nil else { return }
|
|
426
|
-
|
|
427
|
-
// File-based init — reads cometchat-settings.json from the bundle and
|
|
428
|
-
// attributes the integration as ai-agent for /user_sessions telemetry.
|
|
429
|
-
CometChatCalls.initFromSettings(onSuccess: { _ in
|
|
430
|
-
// ready — register PushKit (rule 1.2) and CXProvider (rule 1.7) here
|
|
431
|
-
}, onError: { error in
|
|
432
|
-
print("CometChatCalls init failed: \(error?.errorDescription ?? "")")
|
|
433
|
-
})
|
|
434
|
-
}
|
|
435
|
-
```
|
|
436
|
-
|
|
437
|
-
**How the attribution works (don't fight it):** `initFromSettings` persists `integrationSource = "ai-agent"` (appId-scoped) *before* delegating to the normal init. The identification POST itself fires on `CometChatCalls.login(...)` success or on a later `init` that restores a persisted session, and is deduped via a SHA-256 hash — repeats are no-ops until the app/SDK version or integration source changes. Two consequences:
|
|
438
|
-
|
|
439
|
-
- **Do NOT scaffold a raw `CallAppSettingsBuilder` init when `initFromSettings` is available** — a direct builder init re-attributes the integration as `manual`.
|
|
440
|
-
- When the **Chat SDK is linked in the same app** (dual-SDK ringing mode, additive mode), the Calls SDK suppresses its own self-report — the chat side reports instead, so ALSO use the chat-side file-based init there (`CometChatUIKit.initFromSettings` — `cometchat-ios-core` §2). The calls-side `initFromSettings` is still the right init (one config file, ai-agent source persisted either way).
|
|
441
|
-
|
|
442
|
-
### Init — `CallAppSettingsBuilder` (fallback — 5.0.1 and earlier)
|
|
443
|
-
|
|
444
|
-
```swift
|
|
445
|
-
let callAppSettings = CallAppSettingsBuilder()
|
|
446
|
-
.setAppId(Secrets.cometchatAppID)
|
|
447
|
-
.setRegion(Secrets.cometchatRegion)
|
|
448
|
-
.build()
|
|
449
|
-
|
|
450
|
-
CometChatCalls.init(callsAppSettings: callAppSettings, onSuccess: { _ in
|
|
451
|
-
// ready
|
|
452
|
-
}, onError: { error in
|
|
453
|
-
print("CometChatCalls.init failed: \(error?.errorDescription ?? "")")
|
|
454
|
-
})
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
Credentials via `Secrets.swift` (gitignored) or `.xcconfig` Build Settings — see `cometchat-ios-core`.
|
|
458
|
-
|
|
459
|
-
---
|
|
460
|
-
|
|
461
|
-
## 3. Components catalog
|
|
462
|
-
|
|
463
|
-
### Calls SDK primitives (used in standalone or wherever you build custom UI)
|
|
464
|
-
|
|
465
|
-
| Type | Purpose |
|
|
58
|
+
## The five components
|
|
59
|
+
| Component | Role |
|
|
466
60
|
|---|---|
|
|
467
|
-
| `
|
|
468
|
-
| `
|
|
469
|
-
| `
|
|
470
|
-
| `
|
|
471
|
-
| `
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
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.)
|
|
486
88
|
|
|
487
89
|
```swift
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
The kit-default additive recipe:
|
|
534
|
-
1. Confirm `CometChatUIKitSwift` is present (CallsSDK is bundled — nothing extra to install).
|
|
535
|
-
2. Set **`.enable(inAppIncomingCall: true)`** on the `UIKitSettings` builder at init (the one calling switch). If the integration was scaffolded with **`CometChatUIKit.initFromSettings`** (`cometchat-ios-core` §2 — the skills default), telemetry attribution is already handled on the chat side; the vendored calls framework needs no separate init or attribution step.
|
|
536
|
-
3. Add Background Modes (`voip`, `remote-notification`, `audio`) + camera/mic permissions to `Info.plist`.
|
|
537
|
-
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.
|
|
538
|
-
5. (Optional) CallKit + PushKit for background VoIP (asks user — same opt-in as Android).
|
|
539
|
-
|
|
540
|
-
Only reach for `CometChatCalls.init` + `generateToken`/`startSession` (§1.1) when building a **custom call surface** without the kit's call components.
|
|
541
|
-
|
|
542
|
-
## 6. Anti-patterns
|
|
543
|
-
|
|
544
|
-
1. **Skipping CallKit + PushKit** in standalone mode. The app cannot ring backgrounded/terminated devices any other way. App Store reviewers test this.
|
|
545
|
-
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`.
|
|
546
|
-
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.
|
|
547
|
-
4. **Declaring `voip` in `UIBackgroundModes` without using PushKit.** Apple rejects.
|
|
548
|
-
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.
|
|
549
|
-
6. **Using SwiftUI `.alert` for incoming calls.** It only fires when the app is foregrounded. Use CallKit (rule 1.7).
|
|
550
|
-
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.
|
|
551
|
-
8. **Hand-rolling `CallAppSettingsBuilder` init when `initFromSettings` is available (5.0.2+, §2).** The raw builder init re-attributes the integration as `manual` — file-based init is the skills path; the builder is only the pre-5.0.2 fallback.
|
|
552
|
-
|
|
553
|
-
## 7. Verification checklist
|
|
554
|
-
|
|
555
|
-
**Static:**
|
|
556
|
-
|
|
557
|
-
- [ ] `CometChatCallsSDK` in SPM Package.resolved or Podfile.lock
|
|
558
|
-
- [ ] `CometChat.init` followed by `CometChatCalls.initFromSettings` in app entry (builder `CometChatCalls.init` only as the pre-5.0.2 fallback — §2)
|
|
559
|
-
- [ ] `cometchat-settings.json` present, has the `callsSDK` section, and listed under Copy Bundle Resources
|
|
560
|
-
- [ ] PushKit registry listening on `.voIP`
|
|
561
|
-
- [ ] `CXProvider` configured with `CXProviderConfiguration` (app name + ringtone if any)
|
|
562
|
-
- [ ] `CXProviderDelegate` implements answer + end actions
|
|
563
|
-
- [ ] `Info.plist` has `NSMicrophoneUsageDescription` + `NSCameraUsageDescription`
|
|
564
|
-
- [ ] `Info.plist` `UIBackgroundModes` has `audio` + `voip` + `remote-notification`
|
|
565
|
-
- [ ] Hangup path includes `endSession` + `setActive(false, options: .notifyOthersOnDeactivation)` + `cxProvider.reportCall(...endedAt:reason:)`
|
|
566
|
-
- [ ] **Standalone only:** No in-app incoming-call screen — CallKit owns it
|
|
567
|
-
|
|
568
|
-
**Runtime (real device):**
|
|
569
|
-
|
|
570
|
-
- [ ] Outgoing call connects, two-way audio + video
|
|
571
|
-
- [ ] Incoming call rings on lock screen (device locked + app terminated)
|
|
572
|
-
- [ ] Tap "Answer" on lock screen → app opens directly into ongoing call
|
|
573
|
-
- [ ] Hangup ends call, camera light off, music resumes if it was playing
|
|
574
|
-
- [ ] Background the app during a call → audio continues
|
|
575
|
-
- [ ] Lock device during a call → ongoing-call UI on lock screen, audio continues
|
|
576
|
-
|
|
577
|
-
## 8. Pointers
|
|
578
|
-
|
|
579
|
-
- `references/audio-modes-and-controls.md` — audio-route switching (speaker/earpiece/Bluetooth) + custom control panel (button-disable matrix)
|
|
580
|
-
- `cometchat-ios-core` — Chat SDK init, login, `Secrets.swift` conventions
|
|
581
|
-
- `cometchat-ios-components` — full UI Kit catalog (additive mode)
|
|
582
|
-
- `cometchat-ios-push` — APNs setup; some overlap with PushKit but distinct (PushKit is VoIP-only)
|
|
583
|
-
- `cometchat-ios-production` — server-minted tokens, security checklist
|
|
584
|
-
- `cometchat-ios-troubleshooting` — common failure modes (PushKit delivery, CallKit reporting timing, ENABLE_USER_SCRIPT_SANDBOXING)
|
|
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 } /* … */ })
|
|
119
|
+
```
|
|
120
|
+
|
|
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.
|
|
123
|
+
|
|
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.
|
|
126
|
+
|
|
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.
|
|
131
|
+
|
|
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.
|