@cometchat/skills 4.4.2 → 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/LICENSE +21 -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 -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 +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 -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 +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 +112 -563
- 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 -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-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 -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-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 -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
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Switching users (account switch / shared device) — Calls SDK v5
|
|
2
|
+
|
|
3
|
+
> **Verified live 2026-09-08** on two emulators (Pixel_10 + Pixel_8), `calls-sdk-android 5.0.4` +
|
|
4
|
+
> `chat-sdk-android 5.0.5`. The docs' authentication page does NOT cover this path (DOCS-BACKLOG C13).
|
|
5
|
+
|
|
6
|
+
## The trap
|
|
7
|
+
|
|
8
|
+
`CometChatCalls.logout()` — **and the implicit logout inside `login(<a different uid>)`** — leaves the
|
|
9
|
+
Calls SDK **de-initialized**: `CometChatCalls.isInitialized()` returns `false` afterwards. Nothing in the
|
|
10
|
+
docs says so, and `login()` for the new user still reports **`onSuccess`**. The failure only surfaces one
|
|
11
|
+
call later:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
generateToken FAILED: ERROR_COMETCHAT_CALLS_SDK_INIT
|
|
15
|
+
"Please call the CometChatCalls.init() method preferably in the onCreate() method of the
|
|
16
|
+
application class before calling any other methods related to CometChatCalls"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
That message sends you hunting for a missing `init()` in `Application.onCreate()` — which **is** there and
|
|
20
|
+
**did** resolve (`Init Successful`) at process start. The real cause is the logout that happened since.
|
|
21
|
+
|
|
22
|
+
**Evidence (measured, same device, same build):**
|
|
23
|
+
|
|
24
|
+
| Sequence | `isInitialized()` | `generateToken` |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| init → login(uid-3) → generateToken *(no switch)* | `true` | **OK** → `onSessionJoined` |
|
|
27
|
+
| init → login(uid-2) with uid-3 still logged in | — | **FAILS** `ERROR_COMETCHAT_CALLS_SDK_INIT` |
|
|
28
|
+
| init → logout both → login(uid-2) | **`false`** before login, `false` after | **FAILS** (same error) |
|
|
29
|
+
| init → logout both → **re-init** → login(uid-2) | **`true`** | **OK** → `onSessionJoined` |
|
|
30
|
+
|
|
31
|
+
Logging out is not enough on its own — **the re-init is the step that fixes it.**
|
|
32
|
+
|
|
33
|
+
## The sequence (BAKED)
|
|
34
|
+
|
|
35
|
+
Switching from `current` to `uid` — do all four, in order, each chained off the previous callback:
|
|
36
|
+
|
|
37
|
+
1. `CometChatCalls.logout(listener)` — Calls SDK
|
|
38
|
+
2. `CometChat.logout(listener)` — Chat SDK (ringing only; also clears the stale chat session)
|
|
39
|
+
3. `CometChatCalls.initFromSettings(context, listener)` — **re-init, and WAIT for `onSuccess`**
|
|
40
|
+
4. `CometChatCalls.login(uid, authKey, listener)` (+ `CometChat.login` for ringing)
|
|
41
|
+
|
|
42
|
+
```kotlin
|
|
43
|
+
fun switchUser(uid: String, authKey: String, then: () -> Unit) {
|
|
44
|
+
val current = CometChatCalls.getLoggedInUser()
|
|
45
|
+
if (current == null) { loginBoth(uid, authKey, then); return } // nobody logged in
|
|
46
|
+
if (current.uid == uid) { then(); return } // SAME user — nothing to do
|
|
47
|
+
|
|
48
|
+
CometChatCalls.logout(object : CometChatCalls.CallbackListener<String>() {
|
|
49
|
+
override fun onSuccess(msg: String) {
|
|
50
|
+
CometChat.logout(object : CometChat.CallbackListener<String>() { // ringing builds only
|
|
51
|
+
override fun onSuccess(m: String) = reinitThenLogin(uid, authKey, then)
|
|
52
|
+
override fun onError(e: com.cometchat.chat.exceptions.CometChatException) =
|
|
53
|
+
reinitThenLogin(uid, authKey, then) // stale chat session is non-fatal
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
override fun onError(e: CometChatException) { /* surface e.code; do NOT continue silently */ }
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private fun reinitThenLogin(uid: String, authKey: String, then: () -> Unit) {
|
|
61
|
+
// MANDATORY: logout left isInitialized() == false. Re-init BEFORE login or generateToken
|
|
62
|
+
// will fail with the misleading ERROR_COMETCHAT_CALLS_SDK_INIT.
|
|
63
|
+
CometChatCalls.initFromSettings(context, object : CometChatCalls.CallbackListener<String>() {
|
|
64
|
+
override fun onSuccess(result: String) = loginBoth(uid, authKey, then)
|
|
65
|
+
override fun onError(e: CometChatException) { /* surface e.code */ }
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Rules
|
|
71
|
+
|
|
72
|
+
- **Never guard login with `getLoggedInUser() != null` alone.** That is the docs' snippet
|
|
73
|
+
(`if (getLoggedInUser() == null) login(...)`) and it only handles "same user". On a shared or
|
|
74
|
+
re-used device it silently places calls **as the previous user**. Branch on the **uid**:
|
|
75
|
+
`getLoggedInUser()?.uid == uid`.
|
|
76
|
+
- **Leave the call first.** `CallSession.getInstance().leaveSession()` (and `CometChat.endCall` if the
|
|
77
|
+
session came from ringing) before logging out — a switch during a live session leaks it.
|
|
78
|
+
- **Re-register the ringing `CallListener`** after the new login; listener IDs from the old session are
|
|
79
|
+
bound to the old user (`references/ringing.md`).
|
|
80
|
+
- **Fresh installs are unaffected** — the trap needs a pre-existing session, which is exactly why it
|
|
81
|
+
survives testing on a clean emulator and then bites on a real user's device.
|
|
82
|
+
|
|
83
|
+
## Upstream status
|
|
84
|
+
|
|
85
|
+
- **Docs (DOCS-BACKLOG C13):** `/calls/android/authentication` documents `logout()` as "clears the local
|
|
86
|
+
session" with no mention that it also de-initializes the SDK, and its login guard covers only the
|
|
87
|
+
null case. Both need the switch path.
|
|
88
|
+
- **SDK (class C):** `login(<different uid>)` reporting `onSuccess` while leaving the SDK de-initialized,
|
|
89
|
+
then failing one call later with an error naming the wrong cause, is an SDK defect (AUDIT-194).
|
|
90
|
+
Drop this workaround's re-init step if a 5.0.x ships that re-initializes on login.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cometchat-android-v5-sdk
|
|
3
|
+
description: "Build chat on Android with the headless CometChat Chat SDK v5 and your OWN UI — init/login ordering, the method map, request-builder pagination, listener lifecycle, and a production-ready app surface (optimistic updates, error states, sized shell). Use when the app needs custom UI instead of the drop-in UI Kit. Triggers: 'cometchat android sdk', 'chat with my own ui android', 'headless cometchat android', 'send message with chat-sdk-android', 'cometchat message listener kotlin'."
|
|
4
|
+
license: "MIT"
|
|
5
|
+
compatibility: "Android minSdk >=24; Kotlin >=1.9 / AGP >=8; JVM target 11; com.cometchat:chat-sdk-android ^5 (5.0.x, verified 5.0.5); optional com.cometchat:calls-sdk-android ^5"
|
|
6
|
+
metadata:
|
|
7
|
+
author: "CometChat"
|
|
8
|
+
version: "1.0.0"
|
|
9
|
+
tags: "cometchat android sdk v5 headless kotlin custom-ui chat-sdk"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
> **Ground truth:** catalog `sdk-android-v5.json` (curated from the INSTALLED `com.cometchat:chat-sdk-android:5.0.5` AAR — the existence oracle) + `features.sdk-android-v5.json` + `contracts.sdk-android-v5.json` (`sdk-chat-surface` — the completeness floor). Docs: `references/docs-map.md`. ⚠️ **Android SDK v5 pages are VERSIONED** (`/sdk/android/v5/…`); the unversioned tree is v4. Verify symbols against the catalog; fetch signatures from docs; never trust memory.
|
|
13
|
+
|
|
14
|
+
## Companion skills (read first)
|
|
15
|
+
This skill is **self-contained** for headless builds — it does not depend on a UI Kit core. But: if the user wants ready-made chat UI, the **UI Kit is the better answer** — say so and route to `cometchat-android-v6-core` (drop-in components, far less code). Come here when they explicitly want their own UI, a non-chat surface, or backend-style usage.
|
|
16
|
+
|
|
17
|
+
## Use this skill when
|
|
18
|
+
"use the CometChat SDK directly", "build chat with my own UI/design system", "I don't want the UI Kit", "send/receive messages programmatically", "custom chat screen in Compose backed by CometChat".
|
|
19
|
+
|
|
20
|
+
## Prerequisites & install
|
|
21
|
+
```kotlin
|
|
22
|
+
// settings.gradle(.kts) → dependencyResolutionManagement.repositories
|
|
23
|
+
maven("https://dl.cloudsmith.io/public/cometchat/cometchat/maven/")
|
|
24
|
+
// app/build.gradle.kts
|
|
25
|
+
implementation("com.cometchat:chat-sdk-android:5.0.5") // + calls-sdk-android:5.0.4 for calling
|
|
26
|
+
```
|
|
27
|
+
```properties
|
|
28
|
+
# gradle.properties — REQUIRED: chat-sdk-android 5.0.5 still pulls android.arch.lifecycle:extensions:1.1.1 → com.android.support:support-compat:26.1.0
|
|
29
|
+
android.useAndroidX=true
|
|
30
|
+
android.enableJetifier=true
|
|
31
|
+
```
|
|
32
|
+
- **Jetifier is not optional.** Without `android.enableJetifier=true` an AndroidX app fails `checkDebugDuplicateClasses` (`Duplicate class android.support.v4.app.INotificationSideChannel … androidx.core:core and com.android.support:support-compat:26.1.0`). Verified 2026-09-07 (removing the line reproduces it); `dependencyInsight --dependency support-compat` shows the chain. Calling (`calls-sdk-android:5.0.4`) additionally needs `minSdk 26` + the SoLoader init + a manifest `<service>` — `cometchat-android-v5-calls-sdk` Prerequisites.
|
|
33
|
+
Manifest needs `android.permission.INTERNET`. Credentials live in the **gitignored** `app/src/main/assets/cometchat-settings.json` (`appId`, `region`, `credentials.authKey` dev-only). The optional `chatSDK` section carries SDK-level overrides; init succeeds without it, so omit it for a minimal build — **BUT one override is load-bearing for a required surface:**
|
|
34
|
+
|
|
35
|
+
> ⚠️ **Presence is opt-in via `chatSDK.presenceSubscription` — omit it and realtime presence is silently dead.** The app-surface floor requires a presence-aware chat header + users list (`onUserOnline`/`onUserOffline`). `initFromSettings` only subscribes to presence if the asset sets `chatSDK.presenceSubscription`; **if it's absent, `onUserListener` events NEVER fire** (docs `/sdk/android/v5/user-presence`: "If none of the above methods are set, no presence will be sent"). Accepted values (verified against the AAR settings parser — bad values throw `ERR_SETTINGS_FILE_INVALID_PRESENCE_TYPE`): `ALL_USERS` · `FRIENDS` · `ROLES` (with a sibling `roles` list) · `NONE`. So whenever you wire the presence surface, ship:
|
|
36
|
+
> ```json
|
|
37
|
+
> { "appId": "…", "region": "…", "credentials": { "authKey": "…" },
|
|
38
|
+
> "chatSDK": { "presenceSubscription": "ALL_USERS" } }
|
|
39
|
+
> ```
|
|
40
|
+
> Distinguish the two presence paths: `getUser(uid).status` / the `UsersRequest` list `status` field is a **one-time snapshot** (works without the subscription); the **realtime** `onUserOnline`/`onUserOffline` transitions need the subscription above.
|
|
41
|
+
|
|
42
|
+
> ⚠️ **Docs drift — `ConnectionListener`.** `/sdk/android/v5/connection-status.md` shows
|
|
43
|
+
> `override fun onError(e: CometChatException)`. That does not compile: the member is
|
|
44
|
+
> **`onConnectionError(e: CometChatException?)`**, and `ConnectionListener` is an **interface** —
|
|
45
|
+
> `object : CometChat.ConnectionListener` with **no parentheses**, unlike `CometChat.MessageListener()`.
|
|
46
|
+
> Verified against `CometChat.java:10737`.
|
|
47
|
+
|
|
48
|
+
## Init & login ordering (BAKED — invariant)
|
|
49
|
+
`CometChat.initFromSettings(...)` resolves → `login(...)` resolves → everything else. Any SDK call before init fails; login before init **fails silently**.
|
|
50
|
+
```kotlin
|
|
51
|
+
import com.cometchat.chat.core.CometChat
|
|
52
|
+
import com.cometchat.chat.exceptions.CometChatException
|
|
53
|
+
import com.cometchat.chat.models.User
|
|
54
|
+
|
|
55
|
+
CometChat.initFromSettings(context, object : CometChat.CallbackListener<String>() {
|
|
56
|
+
override fun onSuccess(p: String) { // init resolved — telemetry source persisted
|
|
57
|
+
if (CometChat.getLoggedInUser() == null) {
|
|
58
|
+
// ⚠️ TWO DIFFERENT overloads — they are not interchangeable:
|
|
59
|
+
// dev : login(uid, authKey, listener) ← 3 args, uid REQUIRED
|
|
60
|
+
// prod : login(authToken, listener) ← 2 args, NO uid (the token identifies the user)
|
|
61
|
+
// Passing a token in the 3-arg form sends it as an apiKey and fails.
|
|
62
|
+
// WHERE `authKey` COMES FROM (headless has no UI-Kit shortcut): read it back out of the
|
|
63
|
+
// same gitignored settings asset you already ship — never hardcode it, and never add a
|
|
64
|
+
// second copy in source:
|
|
65
|
+
// val cfg = JSONObject(assets.open("cometchat-settings.json").bufferedReader().readText())
|
|
66
|
+
// val authKey = cfg.getJSONObject("credentials").getString("authKey")
|
|
67
|
+
// Guard the read: if the asset is missing this throws BEFORE the SDK can report its own
|
|
68
|
+
// clean ERR_SETTINGS_FILE_NOT_FOUND, turning a clear error into a crash.
|
|
69
|
+
CometChat.login(uid, authKey, object : CometChat.CallbackListener<User>() {
|
|
70
|
+
override fun onSuccess(user: User) { /* unlock the app */ }
|
|
71
|
+
override fun onError(e: CometChatException) { /* surface e.code + e.message */ }
|
|
72
|
+
})
|
|
73
|
+
} else { /* session already live */ }
|
|
74
|
+
}
|
|
75
|
+
override fun onError(e: CometChatException?) { /* surface — do NOT proceed */ }
|
|
76
|
+
})
|
|
77
|
+
```
|
|
78
|
+
`initFromSettings` reads the assets settings file and persists the integration source; the classic `CometChat.init(context, appId, AppSettings, callback)` still exists but is **not** the default (loses attribution). **Prod:** mint a per-user auth token server-side and log in with it; the Auth Key is dev-only. Re-logging a *different* user requires `logout` first.
|
|
79
|
+
|
|
80
|
+
## SDK method map (BAKED closed list — catalog-verified)
|
|
81
|
+
**Constants & models packages** — `com.cometchat.chat.core.*` (`CometChat`, `Call`, and the `*Request`/`*RequestBuilder` types) · `com.cometchat.chat.models.*` (`User`, `Group`, `TextMessage`, `MediaMessage`, `BaseMessage`, `TypingIndicator`) · `com.cometchat.chat.constants.CometChatConstants` (**`RECEIVER_TYPE_USER`/`RECEIVER_TYPE_GROUP` live HERE, not on `CometChat`**) · `com.cometchat.chat.exceptions.CometChatException`.
|
|
82
|
+
**Auth overloads (do not conflate)** — `login(uid, authKey, listener)` for dev; `login(authToken, listener)` for production, which takes **no uid** because the server-minted token carries the identity. Getting this wrong is silent: the token goes through as an apiKey and auth fails.
|
|
83
|
+
**Session** `initFromSettings` · `init` (legacy) · `login` · `logout` · `getLoggedInUser` · `getUserAuthToken` · `addLoginListener`/`LoginListener`/`removeLoginListener`
|
|
84
|
+
**Messaging** `TextMessage` · `MediaMessage` · `CustomMessage` · `InteractiveMessage` · `sendMessage` · `sendMediaMessage` · `sendCustomMessage` · `sendInteractiveMessage` · `editMessage` · `deleteMessage` · `flagMessage`/`getFlagReasons` · `sendTransientMessage`/`TransientMessage` · `getMessageDetails` · `BaseMessage` · `Attachment` · `createUploadFileRequest`/`UploadFileRequest`/`UploadFileListener`
|
|
85
|
+
**Fetching (always via a request builder + pagination)** `MessagesRequest.MessagesRequestBuilder` · `ConversationsRequest.ConversationsRequestBuilder` · `UsersRequest.UsersRequestBuilder` · `GroupsRequest.GroupsRequestBuilder` · `GroupMembersRequest.GroupMembersRequestBuilder` · `BannedGroupMembersRequest…` · `BlockedUsersRequest…` · `ReactionsRequest…` · `NotificationFeedRequest…`
|
|
86
|
+
**Realtime listeners** `addMessageListener`/`MessageListener`/`removeMessageListener` · `addUserListener`/`UserListener`/… · `addGroupListener`/`GroupListener`/… · `addCallListener`/`CallListener`/… · `addConnectionListener`/`ConnectionListener`/… · `addAIAssistantListener`/`AIAssistantListener`/… · `addNotificationFeedListener`/`NotificationFeedListener`/…
|
|
87
|
+
**Receipts & typing** `startTyping`/`endTyping`/`TypingIndicator` · `markAsDelivered`/`markAsRead`/`markAsUnread`/`markConversationAsRead` · `MessageReceipt`/`getMessageReceipts` · unread: `getUnreadMessageCount`/`…ForUser`/`…ForGroup`
|
|
88
|
+
**Reactions** `addReaction`/`removeReaction`/`Reaction`/`ReactionCount`
|
|
89
|
+
**Users** `getUser` · `createUser`/`updateUser`/`updateCurrentUserDetails` · `blockUsers`/`unblockUsers` · `User`
|
|
90
|
+
**Groups** `createGroup`/`createGroupWithMembers` · `joinGroup`/`leaveGroup` · `updateGroup`/`deleteGroup`/`getGroup`/`getJoinedGroups` · `addMembersToGroup`/`kickGroupMember`/`banGroupMember`/`unbanGroupMember` · `updateGroupMemberScope`/`transferGroupOwnership` · `Group`/`GroupMember`
|
|
91
|
+
**Conversations** `getConversation` · `deleteConversation` · `tagConversation` · `Conversation`
|
|
92
|
+
**Calls** `initiateCall`/`acceptCall`/`rejectCall`/`endCall`/`startCall` · `getActiveCall`/`clearActiveCall` · `Call`/`CallSettings.CallSettingsBuilder`
|
|
93
|
+
**AI** `getSmartReplies` · `getConversationStarter` · `getConversationSummary` · `askBot` · `isAIFeatureEnabled` · `AIAssistantMessage` + the `AIAssistant*Event` family
|
|
94
|
+
**Push & feed** `registerTokenForPushNotification` · `CometChatNotifications` · `PushPlatforms` · `NotificationFeedItem`/`getNotificationFeedUnreadCount`
|
|
95
|
+
**Connection** `getConnectionStatus` · `connect`/`disconnect`/`ping`
|
|
96
|
+
Not in this map and not in the catalog ⇒ does not exist: fetch the page via `references/docs-map.md` before assuming.
|
|
97
|
+
|
|
98
|
+
## Listener lifecycle (the #1 source of Android SDK bugs)
|
|
99
|
+
Every `add*Listener(UNIQUE_ID, …)` **must** have a matching `remove*Listener(UNIQUE_ID)` on teardown — `onDestroy` (Activity/Fragment), `DisposableEffect`'s `onDispose` (Compose), or `onCleared` (ViewModel). Register with a stable, unique id (e.g. the screen's class name); registering the same id twice replaces silently, never removing leaks the callback and duplicates handling after rotation.
|
|
100
|
+
```kotlin
|
|
101
|
+
DisposableEffect(Unit) {
|
|
102
|
+
CometChat.addMessageListener(LISTENER_ID, object : CometChat.MessageListener() {
|
|
103
|
+
override fun onTextMessageReceived(message: TextMessage) { /* append to state */ }
|
|
104
|
+
})
|
|
105
|
+
onDispose { CometChat.removeMessageListener(LISTENER_ID) }
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
Realtime arrives via listeners — **never poll**.
|
|
109
|
+
|
|
110
|
+
## Least-code recipe — the production floor (contract `sdk-chat-surface`)
|
|
111
|
+
Because the SDK ships no UI, a generic "build chat with the SDK" must deliver a **complete, production-ready app**, not bare bubbles. The floor (full text in `contracts.sdk-android-v5.json`, UI spec in `references/app-surface.md`):
|
|
112
|
+
- **Data**: conversations + users + groups lists, each **searchable** (`setSearchKeyword` on the builder) and **paginated** via request builders (`setLimit` + fetch-next) — never one unbounded fetch. Scope the request to the product (1:1-only vs groups) instead of filtering client-side.
|
|
113
|
+
- **Messaging**: send text/media, message history, **threads** via `setParentMessageId`, edit/delete/react/report — each wired to the SDK **and** reflected in the UI, with own-message gating for edit/delete.
|
|
114
|
+
- **Realtime**: message/user/group/connection listeners registered and removed as above; typing indicators and receipts wired.
|
|
115
|
+
- **Detail screens**: user (block/unblock) and group (add/kick/ban/scope/leave), role-gated.
|
|
116
|
+
- **UX quality**: **optimistic updates** (show the message as sending immediately, reconcile in `onSuccess`, roll back + surface `CometChatException.message` in `onError`), **loading/empty/error states everywhere** (never a blank screen or `[object Object]`), a **sized shell** (`fillMaxSize`/`match_parent`, list scrolls internally, insets + IME handled), and your app's **existing design system** (Material3 theme or your tokens) — never ad-hoc inline styling.
|
|
117
|
+
- **Errors**: every `CallbackListener` implements `onError` and surfaces something actionable. An empty `onError {}` is the defect this contract exists to prevent.
|
|
118
|
+
|
|
119
|
+
## Deep references (load only when the task needs them)
|
|
120
|
+
- `references/docs-map.md` — intent → the exact `/sdk/android/v5/<page>.md` to fetch (+ the v5-vs-v4 URL trap and the scoped LLM index).
|
|
121
|
+
- `references/app-surface.md` — the own-UI production floor in detail (state model, optimistic mutations, list/pagination patterns, error/empty/loading, sizing).
|
|
122
|
+
|
|
123
|
+
## Common pitfalls
|
|
124
|
+
**reversed param order** — `updateGroupMemberScope(UID, GUID, scope, …)` vs `transferGroupOwnership(GUID, UID, …)` · **search-keyword casing differs per builder** — `UsersRequestBuilder.setSearchKeyword` and `ConversationsRequestBuilder.setSearchKeyword` are lowercase, but `GroupsRequestBuilder.setSearchKeyWord` has a **capital W** (SDK inconsistency; using `setSearchKeyword` on GroupsRequest is `Unresolved reference`) · **conversations search is plan-gated** — `ConversationsRequestBuilder.setSearchKeyword`/`setUnread` need the **"Conversation & Advanced Search"** feature (Advanced/Custom plan + dashboard toggle); off-plan it **silently returns the unfiltered list** (a search box that looks broken). Users/Groups search is NOT plan-gated. · passing an auth **token** into the 3-arg `login(uid, authKey, …)` (tokens use the 2-arg `login(authToken, …)`) · `CometChat.RECEIVER_TYPE_USER` (it is `CometChatConstants.RECEIVER_TYPE_USER`) · **presence never fires without `chatSDK.presenceSubscription`** in the settings asset (see Prerequisites) · importing `Call` from `chat.models` instead of `chat.core` · Any SDK call before init resolves · login before init (silent failure) · Auth Key shipped in a release build · listeners never removed (duplicate handling after rotation) · polling instead of listeners · unbounded fetches with no pagination · empty `onError` blocks · blocking the main thread waiting on callbacks · re-login without logout · using the unversioned `/sdk/android/` v4 docs · rebuilding UI the UI Kit already ships (when the user would accept drop-ins).
|
|
125
|
+
|
|
126
|
+
## Verify it works
|
|
127
|
+
Every symbol you emitted is in `sdk-android-v5.json` (Tier-1) and the app compiles: run `./gradlew :app:assembleDebug` in the user's app. On device: init → login succeed (logcat); the conversations/users/groups lists load and paginate; sending appears instantly and reconciles; a message from another user arrives **live** (listener, not refresh); edit/delete/react update in place; rotating the screen doesn't duplicate messages (listener lifecycle); force an error (airplane mode) → a readable error state, not a blank screen or crash. Live backend round-trip smoke for this family is **not automated yet** (parked with the Android native harness) — verify manually and say so.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# app-surface — the production floor for an own-UI Android chat app (Chat SDK v5)
|
|
2
|
+
|
|
3
|
+
The SDK ships **no UI**, so "build chat with the SDK" has no visual default — without a floor, output
|
|
4
|
+
degrades to bare bubbles. This file is that floor: the deterministic minimum for a generic prompt.
|
|
5
|
+
Encoded as `contracts.sdk-android-v5.json` → `sdk-chat-surface`; symbols verified against
|
|
6
|
+
`catalogs/sdk-android-v5.json`. Exact signatures: `docs-map.md`.
|
|
7
|
+
|
|
8
|
+
## 1. Shell & sizing
|
|
9
|
+
- The chat screen **fills the window**: `Modifier.fillMaxSize()` (Compose) / `match_parent` (Views).
|
|
10
|
+
- Three regions: header (who you're talking to) · **scrolling message list** · composer pinned to the
|
|
11
|
+
bottom. The LIST scrolls internally (`LazyColumn` / `RecyclerView`) — never nest it in another
|
|
12
|
+
scrollable, never let the page itself grow.
|
|
13
|
+
- **Insets + IME**: `enableEdgeToEdge()` + `imePadding()`/`navigationBarsPadding()` (Compose) or
|
|
14
|
+
`windowSoftInputMode="adjustResize"` (Views), so the composer stays visible while typing and nothing
|
|
15
|
+
sits under the system bars.
|
|
16
|
+
- New messages: keep the list pinned to the newest message when the user is already at the bottom;
|
|
17
|
+
don't yank the scroll position when they've scrolled up.
|
|
18
|
+
|
|
19
|
+
## 2. Design system — reuse, don't invent
|
|
20
|
+
Use the app's existing theme (Material3 `MaterialTheme` / your XML styles / your token set). If the app
|
|
21
|
+
is brand new, establish a small token layer (colors, spacing, radii, type) and build primitives from it.
|
|
22
|
+
**Never** ad-hoc inline colors and one-off dimensions scattered per screen.
|
|
23
|
+
|
|
24
|
+
## 3. State model (own it explicitly)
|
|
25
|
+
Per screen, a single state holder (ViewModel) exposing an immutable UI state:
|
|
26
|
+
`{ items, isLoading, isPaginating, error, hasMore }` plus the input/composer state. Rules:
|
|
27
|
+
- Never mutate a list in place from a callback thread — reduce into new state on the main dispatcher.
|
|
28
|
+
- Keep SDK types at the edge; map to your own UI models so the UI doesn't break on SDK changes.
|
|
29
|
+
- One listener registration per screen, tied to the screen's lifecycle (see §6).
|
|
30
|
+
|
|
31
|
+
## 4. Lists + pagination (every list, every time)
|
|
32
|
+
Build the request once, then page:
|
|
33
|
+
```kotlin
|
|
34
|
+
val request = MessagesRequest.MessagesRequestBuilder()
|
|
35
|
+
.setUID(uid) // or .setGUID(guid)
|
|
36
|
+
.setLimit(30)
|
|
37
|
+
.build()
|
|
38
|
+
// initial load + "load older" → request.fetchPrevious(callback)
|
|
39
|
+
```
|
|
40
|
+
Same builder discipline for `ConversationsRequest`, `UsersRequest`, `GroupsRequest`,
|
|
41
|
+
`GroupMembersRequest`. Rules:
|
|
42
|
+
- **Never** one unbounded fetch. Keep the built request instance for subsequent pages.
|
|
43
|
+
- **Search** via the builder's search-keyword setter — a server-side query, not a client-side filter
|
|
44
|
+
over the page you happen to have. **Two traps, both real:**
|
|
45
|
+
- **Casing differs per builder.** `UsersRequestBuilder.setSearchKeyword` / `ConversationsRequestBuilder.setSearchKeyword` are lowercase, but `GroupsRequestBuilder.`**`setSearchKeyWord`** has a **capital W** (an SDK inconsistency). Using `setSearchKeyword` on GroupsRequest fails to compile (`Unresolved reference`).
|
|
46
|
+
- **Conversations search is PLAN-GATED.** `ConversationsRequestBuilder.setSearchKeyword` (and `setUnread`) require the **"Conversation & Advanced Search"** feature — **Advanced/Custom plan + a dashboard toggle** (Chats → Settings → General Configuration). Off-plan it **silently returns the full, unfiltered list** (no error) — the app ships a search box that looks broken. Users search and Groups search are NOT plan-gated (work on any plan). On a lower plan, gate the conversations-search UI behind a "requires Advanced plan" hint or fall back to a labelled local filter — never present an unfiltered result as a search result.
|
|
47
|
+
- **Scope to the product** (`setConversationType("user")`/`"group"`) rather than filtering after the fact.
|
|
48
|
+
- Guard against double-loading (`isPaginating`) and stop at the empty page (`hasMore = false`).
|
|
49
|
+
|
|
50
|
+
## 5. Optimistic mutations (what makes it feel native)
|
|
51
|
+
Send / edit / delete / react must update the UI **immediately**, then reconcile:
|
|
52
|
+
1. Insert a local item in a `SENDING` state (key it by the message's `muid` so you can match the ack).
|
|
53
|
+
2. Call the SDK.
|
|
54
|
+
3. `onSuccess` → replace the temp item with the server message (`SENT`).
|
|
55
|
+
4. `onError` → mark it `FAILED` with a retry affordance and surface `CometChatException.message`.
|
|
56
|
+
Never block the UI waiting for a round-trip; never leave a failed item looking sent.
|
|
57
|
+
|
|
58
|
+
## 6. Realtime + listener lifecycle
|
|
59
|
+
Register **one** listener per screen with a stable unique id and remove it on teardown:
|
|
60
|
+
- Compose: `DisposableEffect(Unit) { add…; onDispose { remove… } }`
|
|
61
|
+
- Views/ViewModel: register in `onCreate`/`init`, remove in `onDestroy`/`onCleared`
|
|
62
|
+
Cover: `addMessageListener` (incoming text/media), `addUserListener` (presence), `addGroupListener`
|
|
63
|
+
(membership), `addConnectionListener` (offline/online banner). De-duplicate against optimistic items
|
|
64
|
+
(match on message id / muid) so an echoed own-message doesn't appear twice. **Never poll.**
|
|
65
|
+
- **Presence has a config prerequisite.** `addUserListener`'s `onUserOnline`/`onUserOffline` only fire if the settings asset opts in via `chatSDK.presenceSubscription` (`ALL_USERS`/`FRIENDS`/`ROLES`; absent ⇒ no presence — see SKILL.md Prerequisites). The seeded `getUser().status` / list `status` field is a snapshot and works without it; the realtime transition does not. Wiring the header/users presence surface **without** the subscription ships a header stuck on "offline".
|
|
66
|
+
|
|
67
|
+
## 7. Required surfaces (a generic "build chat" delivers ALL of these)
|
|
68
|
+
| Surface | Minimum |
|
|
69
|
+
|---|---|
|
|
70
|
+
| Conversations | list + last message + unread + searchable + delete-conversation |
|
|
71
|
+
| Users / Groups | both lists, searchable, tap → open chat (join group if needed) |
|
|
72
|
+
| Message screen | header (name/presence/typing) · paginated history · composer (text + media) |
|
|
73
|
+
| Message actions | reply-in-thread · react · edit · delete (edit/delete gated to own messages) · report |
|
|
74
|
+
| Thread | `setParentMessageId(...)`-scoped list + its own composer |
|
|
75
|
+
| User detail | profile + block/unblock |
|
|
76
|
+
| Group detail | members + add/kick/ban + scope change + leave, role-gated |
|
|
77
|
+
| Receipts/typing | `markAsRead` on view; `startTyping`/`endTyping` wired to the input |
|
|
78
|
+
|
|
79
|
+
## 8. Loading / empty / error — on every surface
|
|
80
|
+
- **Loading**: skeleton or spinner sized like the content (no layout jump when it resolves).
|
|
81
|
+
- **Empty**: a real message ("No conversations yet") — never a blank screen.
|
|
82
|
+
- **Error**: readable text from `CometChatException.message` + a retry action. Every `CallbackListener`
|
|
83
|
+
implements `onError`; an empty `onError {}` is a defect, and connection loss must be visible.
|
|
84
|
+
|
|
85
|
+
## 9. Anti-patterns (auto-fail this floor)
|
|
86
|
+
Bare bubbles with no lists/actions · unbounded fetches · client-side "search" · polling for new messages ·
|
|
87
|
+
listeners never removed · blank screens on empty/error · swallowed exceptions · main-thread blocking ·
|
|
88
|
+
credentials in source · hand-rolled UI when the user would have accepted the UI Kit (offer it first).
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# docs-map — CometChat Android Chat SDK v5: intent → the exact docs page to fetch
|
|
2
|
+
|
|
3
|
+
## Reaching docs — PREFER the CometChat docs MCP; fetch is the fallback
|
|
4
|
+
The canonical doc channel is the **first-party CometChat docs MCP** — tools `search_cometchat_docs`,
|
|
5
|
+
`fetch_cometchat_doc_page`, and `get_cometchat_implementation_bundle`. **If those tools are connected,
|
|
6
|
+
use them instead of a raw web fetch:**
|
|
7
|
+
- **Find the page** → `search_cometchat_docs(query, version?)` — replaces browsing the scoped `llms-*` index.
|
|
8
|
+
- **Read the page** → `fetch_cometchat_doc_page(path)` — pass the SAME versioned `<path>` the tables below
|
|
9
|
+
list (e.g. `/sdk/android/v5/<page>`); the MCP resolves the `.md` twin and returns raw Markdown. A full
|
|
10
|
+
`https://…/docs/<path>` URL also works. (The v5-vs-v4 URL trap below still applies to the path you pass.)
|
|
11
|
+
- **A whole feature/recipe** → `get_cometchat_implementation_bundle(...)` is **NON-AUTHORITATIVE** — curated STATIC recipes that can lag the live docs (verified stale vs v7: e.g. `CometChatConversationsWithMessages`, `css-variables.css`). Treat any bundle as a hint only: RECONCILE it against the `fetch_cometchat_doc_page` result + the pack's hardening; never emit bundle code verbatim.
|
|
12
|
+
|
|
13
|
+
The MCP reads whatever docs environment it is pointed at (production by default; a preview when repointed),
|
|
14
|
+
so it also carries the environment-swap concern below — no hardcoded host on the skill side.
|
|
15
|
+
|
|
16
|
+
**If the MCP tools are NOT connected:** add it (`claude mcp add --transport http cometchat-docs https://mcp.cometchat.com/mcp`, or reinstall/enable the plugin) and retry; only if it still will not connect, fall back to a plain fetch via `SDK_DOCS_BASE` (defined next).
|
|
17
|
+
Either way the `<path>` catalog in this file is the source of truth for WHICH page — MCP-vs-fetch is only HOW.
|
|
18
|
+
|
|
19
|
+
## SDK_DOCS_BASE — the fetch FALLBACK entry point (⚠️ SWAP HERE to change environments)
|
|
20
|
+
```
|
|
21
|
+
SDK_DOCS_BASE = https://www.cometchat.com/docs
|
|
22
|
+
```
|
|
23
|
+
> **⚠️ URL TRAP — the Android SDK is VERSIONED.** v5 pages live at `/sdk/android/v5/<page>`.
|
|
24
|
+
> The UNVERSIONED tree `/sdk/android/<page>` is **v4** — never fetch it for a v5 build.
|
|
25
|
+
> (The UI Kit is the opposite: its latest, v6, lives at the unversioned `/ui-kit/android/…`.)
|
|
26
|
+
>
|
|
27
|
+
> **Fetch rule:** build a URL as `SDK_DOCS_BASE` + the path shown, then append `.md`.
|
|
28
|
+
> Never decompile the AAR and never answer an API from memory.
|
|
29
|
+
|
|
30
|
+
## The convention
|
|
31
|
+
`SDK_DOCS_BASE` + `<path>` + `.md` → raw Markdown (verbatim code + method signatures, parameters,
|
|
32
|
+
listener contracts). Pages show Kotlin and Java variants where they differ — read the one the app uses.
|
|
33
|
+
```
|
|
34
|
+
Fetch: {SDK_DOCS_BASE}/sdk/android/v5/send-message.md
|
|
35
|
+
```
|
|
36
|
+
Fallback order: `.md` twin → the same URL **without** `.md` (HTML) → **never** kit/AAR internals.
|
|
37
|
+
|
|
38
|
+
## Scoped Android SDK v5 index (prefer over the global llms.txt)
|
|
39
|
+
```
|
|
40
|
+
{SDK_DOCS_BASE}/sdk/android/v5/llms-android-v5.md
|
|
41
|
+
```
|
|
42
|
+
An Android-SDK-v5-only index of every page as a `.md` link, grouped by area (Messaging · Calling ·
|
|
43
|
+
Users · Groups · AI & advanced · Resources & listeners · Advanced). Use it to discover any page not
|
|
44
|
+
in the table below. Global all-products index (large; last resort): `{SDK_DOCS_BASE}/llms.txt`.
|
|
45
|
+
> **DOCS-GAP note:** this scoped index ships with docs branch `docs/android-llms-indexes`; until that
|
|
46
|
+
> merges, the per-page `.md` twins below already work — fall back to this table.
|
|
47
|
+
|
|
48
|
+
## Don't fetch the hot path — it's baked
|
|
49
|
+
Install, `initFromSettings → login` ordering, the method map, and the listener add/remove discipline
|
|
50
|
+
are BAKED in `cometchat-android-v5-sdk`. Fetch ONLY for exhaustive parameters, long-tail methods,
|
|
51
|
+
group/user management details, calling, or edge-case listeners.
|
|
52
|
+
|
|
53
|
+
## The 80% trigger table (URL = `{SDK_DOCS_BASE}` + path, then append `.md`)
|
|
54
|
+
| Intent | Path (append `.md`) |
|
|
55
|
+
|---|---|
|
|
56
|
+
| install / init / app settings | `/sdk/android/v5/setup` |
|
|
57
|
+
| login, auth tokens, session | `/sdk/android/v5/authentication-overview` · `/sdk/android/v5/login-listeners` |
|
|
58
|
+
| send a text message | `/sdk/android/v5/send-message` |
|
|
59
|
+
| media / file / attachments | `/sdk/android/v5/upload-files` |
|
|
60
|
+
| receive messages (listeners) | `/sdk/android/v5/receive-messages` · `/sdk/android/v5/real-time-listeners` |
|
|
61
|
+
| message history / filtering / pagination | `/sdk/android/v5/additional-message-filtering` |
|
|
62
|
+
| conversations list | `/sdk/android/v5/retrieve-conversations` · `/sdk/android/v5/delete-conversation` |
|
|
63
|
+
| threads | `/sdk/android/v5/threaded-messages` |
|
|
64
|
+
| edit / delete / flag a message | `/sdk/android/v5/edit-message` · `delete-message` · `flag-message` |
|
|
65
|
+
| typing indicators | `/sdk/android/v5/typing-indicators` |
|
|
66
|
+
| delivery & read receipts | `/sdk/android/v5/delivery-read-receipts` |
|
|
67
|
+
| reactions | `/sdk/android/v5/reactions` |
|
|
68
|
+
| mentions | `/sdk/android/v5/mentions` |
|
|
69
|
+
| transient messages | `/sdk/android/v5/transient-messages` |
|
|
70
|
+
| users: list / manage / block | `/sdk/android/v5/retrieve-users` · `user-management` · `block-users` |
|
|
71
|
+
| presence | `/sdk/android/v5/user-presence` |
|
|
72
|
+
| groups: list / create / update / join / leave / delete | `/sdk/android/v5/retrieve-groups` · `create-group` · `update-group` · `join-group` · `leave-group` · `delete-group` |
|
|
73
|
+
| group members + moderation | `/sdk/android/v5/retrieve-group-members` · `group-add-members` · `group-kick-member` · `group-change-member-scope` · `transfer-group-ownership` |
|
|
74
|
+
| calling | `/sdk/android/v5/calling-overview` (+ the `/calls/android/*` tree for call UI/behavior) |
|
|
75
|
+
| AI moderation / agents / copilot / chatbots | `/sdk/android/v5/ai-moderation` · `ai-agents` · `ai-user-copilot-overview` · `ai-chatbots-overview` |
|
|
76
|
+
| campaigns · extensions · webhooks | `/sdk/android/v5/campaigns` · `extensions-overview` · `webhooks-overview` |
|
|
77
|
+
| message structure / key concepts | `/sdk/android/v5/message-structure-and-hierarchy` · `key-concepts` |
|
|
78
|
+
| connection status / behaviour | `/sdk/android/v5/connection-status` · `connection-behaviour` |
|
|
79
|
+
| rate limits | `/sdk/android/v5/rate-limits` |
|
|
80
|
+
| Play Store publishing | `/sdk/android/v5/publishing-app-on-playstore` |
|
|
81
|
+
| upgrading from v4 | `/sdk/android/v5/upgrading-from-v4` |
|
|
82
|
+
| changelog | `/sdk/android/v5/changelog` |
|
|
83
|
+
|
|
84
|
+
## Want ready-made UI instead?
|
|
85
|
+
If the user would accept drop-in chat UI, the **Android UI Kit v6** is far less code —
|
|
86
|
+
`cometchat-android-v6-core` and `{SDK_DOCS_BASE}/ui-kit/android/llms-android-v6.md`. Say so before
|
|
87
|
+
hand-building a full chat UI on the SDK.
|
|
88
|
+
|
|
89
|
+
## Not in the table?
|
|
90
|
+
Fetch the scoped index (`{SDK_DOCS_BASE}/sdk/android/v5/llms-android-v5.md`), pick the page, fetch its
|
|
91
|
+
`.md`. Never guess a path; never read AAR internals; never answer an API from memory.
|
|
@@ -1,149 +1,63 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cometchat-android-v6-builder-settings
|
|
3
|
-
description: "CometChat Android
|
|
3
|
+
description: "The CometChat Android v6 settings and session API reference — the assets/cometchat-settings.json file that initFromSettings reads (appId, region, credentials, uiKit toggles), the legacy UIKitSettings builder, and the CometChatUIKit session methods (login, loginWithAuthToken, logout, getLoggedInUser, createUser). Use when configuring init options or wiring auth beyond the core golden path. Triggers: 'cometchat settings json android', 'uikitsettings builder options', 'login with auth token android', 'create a cometchat user from the app', 'enable calling in settings'."
|
|
4
4
|
license: "MIT"
|
|
5
|
-
compatibility: "Android
|
|
5
|
+
compatibility: "Android minSdk >=28; compileSdk >=36; Kotlin >=2.1; AGP >=8.9.1; JVM target 11; com.cometchat:chatuikit-kotlin-android ^6 OR com.cometchat:chatuikit-compose-android ^6 (6.0.x, verified 6.0.5); com.cometchat:chat-sdk-android ^5"
|
|
6
6
|
metadata:
|
|
7
7
|
author: "CometChat"
|
|
8
|
-
version: "
|
|
9
|
-
tags: "cometchat
|
|
8
|
+
version: "1.0.0"
|
|
9
|
+
tags: "cometchat android settings uikitsettings auth v6 login authtoken"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
> **Ground truth:** `com.cometchat
|
|
12
|
+
> **Ground truth:** the installed kit source `com.cometchat.uikit.core.CometChatUIKit` (6.0.5) + the live page `/ui-kit/android/methods` (init · authentication · logout · create user · message helpers). Symbols verified against catalog `android-v6.json`. Fetch exact signatures from the methods page; never guess an overload.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## Purpose
|
|
17
|
-
|
|
18
|
-
Detailed reference for `UIKitSettings.UIKitSettingsBuilder` — all configuration options for initializing the CometChat SDK, including presence subscriptions, calling features, and host overrides.
|
|
14
|
+
## Companion skills (read first)
|
|
15
|
+
- `cometchat-android-v6-core` — owns the DEFAULT path: `initFromSettings → login → render`, the settings file, and credential handling. Come HERE only when a task needs an option or auth variant beyond that default.
|
|
19
16
|
|
|
20
17
|
## Use this skill when
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
val settings = UIKitSettings.UIKitSettingsBuilder()
|
|
39
|
-
|
|
40
|
-
// Required
|
|
41
|
-
.setAppId("APP_ID") // CometChat App ID
|
|
42
|
-
.setRegion("us") // "us" or "eu"
|
|
43
|
-
|
|
44
|
-
// Authentication (dev only — use token auth in production)
|
|
45
|
-
.setAuthKey("AUTH_KEY") // Auth key from dashboard
|
|
46
|
-
|
|
47
|
-
// Presence subscriptions
|
|
48
|
-
.subscribePresenceForAllUsers() // Subscribe to all users' presence
|
|
49
|
-
.subscribePresenceForRoles(listOf("admin")) // Subscribe by roles
|
|
50
|
-
.subscribePresenceForFriends() // Subscribe to friends' presence
|
|
51
|
-
.setRoles(listOf("admin")) // Override the roles list directly (advanced)
|
|
52
|
-
|
|
53
|
-
// Socket connection
|
|
54
|
-
.setAutoEstablishSocketConnection(true) // Auto-connect (default: true)
|
|
55
|
-
|
|
56
|
-
// Calling
|
|
57
|
-
.setEnableCalling(true) // Auto-init CometChatCalls SDK (default: false)
|
|
58
|
-
.setCallSettingsBuilder(sessionSettingsBuilder) // Custom call config (optional) — pass a CometChatCalls.SessionSettingsBuilder
|
|
59
|
-
|
|
60
|
-
// Host overrides (advanced — for on-premise deployments)
|
|
61
|
-
.overrideAdminHost("https://custom-admin.example.com")
|
|
62
|
-
.overrideClientHost("https://custom-client.example.com")
|
|
63
|
-
|
|
64
|
-
.build()
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## 2. Presence Subscription Types
|
|
68
|
-
|
|
69
|
-
Only one subscription type is active at a time. The last one set wins.
|
|
70
|
-
|
|
71
|
-
| Method | Subscription Type | Use Case |
|
|
72
|
-
|---|---|---|
|
|
73
|
-
| (none) | `"NONE"` | No presence updates (default) |
|
|
74
|
-
| `subscribePresenceForAllUsers()` | `"ALL_USERS"` | Small apps where you want all online statuses |
|
|
75
|
-
| `subscribePresenceForRoles(roles)` | `"ROLES"` | Subscribe to specific user roles |
|
|
76
|
-
| `subscribePresenceForFriends()` | `"FRIENDS"` | Social apps with friend lists |
|
|
77
|
-
|
|
78
|
-
## 3. Calling Configuration
|
|
79
|
-
|
|
80
|
-
When `setEnableCalling(true)` is set, `CometChatUIKit.init()` automatically initializes the CometChatCalls SDK after the Chat SDK succeeds:
|
|
81
|
-
|
|
82
|
-
```kotlin
|
|
83
|
-
// Basic calling setup
|
|
84
|
-
val settings = UIKitSettings.UIKitSettingsBuilder()
|
|
85
|
-
.setAppId("APP_ID")
|
|
86
|
-
.setRegion("us")
|
|
87
|
-
.setAuthKey("AUTH_KEY")
|
|
88
|
-
.setEnableCalling(true)
|
|
89
|
-
.build()
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
For custom call settings:
|
|
93
|
-
|
|
94
|
-
```kotlin
|
|
95
|
-
import com.cometchat.calls.core.CometChatCalls
|
|
96
|
-
|
|
97
|
-
// The kit stores/uses a SessionSettingsBuilder (no-arg ctor) — NOT CallSettingsBuilder.
|
|
98
|
-
// setCallSettingsBuilder(Any) casts its arg to CometChatCalls.SessionSettingsBuilder
|
|
99
|
-
// internally; passing a CallSettingsBuilder is silently stored as null.
|
|
100
|
-
val sessionSettingsBuilder = CometChatCalls.SessionSettingsBuilder()
|
|
101
|
-
// configure via the SessionSettingsBuilder setters (see cometchat-android-v6-calls)
|
|
102
|
-
|
|
103
|
-
val settings = UIKitSettings.UIKitSettingsBuilder()
|
|
104
|
-
.setAppId("APP_ID")
|
|
105
|
-
.setRegion("us")
|
|
106
|
-
.setAuthKey("AUTH_KEY")
|
|
107
|
-
.setEnableCalling(true)
|
|
108
|
-
.setCallSettingsBuilder(sessionSettingsBuilder) // param typed Any; pass a SessionSettingsBuilder
|
|
109
|
-
.build()
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
After init, retrieve the stored builder:
|
|
113
|
-
|
|
114
|
-
```kotlin
|
|
115
|
-
val builder: CometChatCalls.SessionSettingsBuilder? = CometChatUIKit.getSessionSettingsBuilder()
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## 4. Checking Initialization State
|
|
119
|
-
|
|
120
|
-
```kotlin
|
|
121
|
-
// Chat SDK initialized?
|
|
122
|
-
CometChatUIKit.isSDKInitialized()
|
|
123
|
-
|
|
124
|
-
// Calls SDK initialized? (only true if enableCalling was true AND init succeeded)
|
|
125
|
-
CometChatUIKit.isCallsSDKInitialized()
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## 5. Application-Level Init Pattern
|
|
129
|
-
|
|
130
|
-
From `master-app-jetpack`, the recommended pattern separates SDK init from Calls SDK init:
|
|
131
|
-
|
|
132
|
-
```kotlin
|
|
133
|
-
class MyApplication : Application() {
|
|
134
|
-
fun onSDKInitialized() {
|
|
135
|
-
// Called after CometChatUIKit.init() succeeds
|
|
136
|
-
// CometChatCalls is auto-initialized if enableCalling = true
|
|
137
|
-
// Register call listeners here
|
|
138
|
-
addCallListener()
|
|
139
|
-
}
|
|
18
|
+
"what can go in the settings file?", "turn on calling in the settings", "log in with a server-minted auth token instead of the auth key", "create a CometChat user from the app", "check who's logged in", "what does the UIKitSettings builder do?".
|
|
19
|
+
|
|
20
|
+
## Prerequisites & install
|
|
21
|
+
Same kit + init as `core`. Everything here is `com.cometchat.uikit.core` — no extra dependency.
|
|
22
|
+
|
|
23
|
+
## The settings file (the DEFAULT input to `initFromSettings`)
|
|
24
|
+
`app/src/main/assets/cometchat-settings.json` — **gitignored** (it carries the dev Auth Key). Read by `CometChatUIKit.initFromSettings(context, callback)`, which parses it, builds the settings, and persists `integrationSource="ai-agent"` for telemetry:
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"appId": "APP_ID",
|
|
28
|
+
"region": "REGION",
|
|
29
|
+
"credentials": { "authKey": "AUTH_KEY" },
|
|
30
|
+
"uiKit": {
|
|
31
|
+
"subscribePresenceForAllUsers": true,
|
|
32
|
+
"enableCalling": false
|
|
33
|
+
}
|
|
140
34
|
}
|
|
141
35
|
```
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
36
|
+
- `appId` + `region` are **required** — missing either fails with `ERR_SETTINGS_INVALID`; a missing file fails with `ERR_SETTINGS_FILE_NOT_FOUND`.
|
|
37
|
+
- `credentials.authKey` is **optional and dev-only** — omit it in production builds and log in with a server-minted auth token.
|
|
38
|
+
- `uiKit.subscribePresenceForAllUsers` defaults to `true`.
|
|
39
|
+
- `uiKit.enableCalling` defaults to `false`. Setting it `true` makes `initFromSettings` auto-initialize the **Calls SDK** — **which means the `com.cometchat:calls-sdk-android` dependency becomes MANDATORY.** Without it the app throws `NoClassDefFoundError: CometChatCalls$SessionSettingsBuilder` from `initCometChatCalls` **during `onCreate`, before any UI renders** (verified on device). The two must always change together (→ `cometchat-android-v6-calls`).
|
|
40
|
+
- The Chat SDK may read an optional `chatSDK` section from the same file. It is **not required** — init succeeds without it. `/sdk/android/v5/setup.md` documents only the classic programmatic `init()` + `AppSettings`, so it will NOT tell you the section's keys; do not send the user there for them.
|
|
41
|
+
|
|
42
|
+
## The legacy `UIKitSettings` builder (know it, don't default to it)
|
|
43
|
+
`UIKitSettings.UIKitSettingsBuilder()` with `.setAppId(...)`, `.setRegion(...)`, `.setAuthKey(...)`, `.setEnableCalling(...)`, `.subscribePresenceForAllUsers()`, `.build()` feeds the classic `CometChatUIKit.init(context, settings, callback)` overload. **It still exists, but it is NOT the default** — it skips the integration-source telemetry that `initFromSettings` persists. Use it only when a project genuinely cannot ship an assets file (e.g. credentials arrive at runtime from your own backend); say so explicitly when you do, and keep credentials out of source either way.
|
|
44
|
+
|
|
45
|
+
## Session / auth methods (`CometChatUIKit`)
|
|
46
|
+
| Method | Use |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `getLoggedInUser(): User?` | **Synchronous** guard — non-null means a session already exists; skip `login`. |
|
|
49
|
+
| `login(uid, CallbackListener<User>)` | Dev/auth-key login for an **existing** user. |
|
|
50
|
+
| `loginWithAuthToken(authToken, CallbackListener<User>)` | **Production** login with a server-minted per-user token. Auth Key never ships to the client. |
|
|
51
|
+
| `logout(CallbackListener<String>)` | End the session. Unregister the push token BEFORE this (`cometchat-android-v6-push`). |
|
|
52
|
+
| `createUser(user, CallbackListener<User>)` | Create a user from the app — **dev/prototype only**; production should mint users server-side with the REST API. |
|
|
53
|
+
|
|
54
|
+
Ordering never changes: **init resolves → (guard) login resolves → chat UI**. Re-logging in a *different* user requires `logout` first. Full lifecycle detail (where to init, config changes, process death): `core/references/lifecycle.md`.
|
|
55
|
+
|
|
56
|
+
## Message-helper reference (on the same docs page)
|
|
57
|
+
`/ui-kit/android/methods` also documents date formatting and constructing `TextMessage` / `MediaMessage` / `CustomMessage` for programmatic sends — fetch that section rather than hand-rolling a message object; the SDK types are the Chat SDK's (`cometchat-android-v5-sdk` / `core/references/docs-map.md` → SDK section).
|
|
58
|
+
|
|
59
|
+
## Common pitfalls
|
|
60
|
+
Committing `cometchat-settings.json` (leaks the Auth Key) · shipping `credentials.authKey` in a release build · using the classic `init(...)` as the default (loses telemetry attribution) · calling `login` before init's `onSuccess` (fails silently) · re-logging in without `logout` · using `createUser` in production · assuming `enableCalling` alone adds calling (the Calls SDK artifact is still required) · reading `getLoggedInUser()` before init.
|
|
61
|
+
|
|
62
|
+
## Verify it works
|
|
63
|
+
Compile against the pinned kit (`./gradlew :app:assembleDebug # in YOUR app (npm run verify:fences:android-v6 is a pack-repo gate)`). On device: with the settings file present, init reports success and login resolves; delete/rename the file → you get `ERR_SETTINGS_FILE_NOT_FOUND` surfaced as a readable error (not a crash); with `enableCalling: true` + the Calls artifact, call buttons appear (Views: automatic; Compose: only with `hideVoiceCallButton = false, hideVideoCallButton = false` on the header — `cometchat-android-v6-calls`); a release build contains no Auth Key (grep the merged assets). Confirm `cometchat-settings.json` is in `.gitignore`.
|