@cometchat/skills 3.1.0 → 4.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.
Files changed (99) hide show
  1. package/README.md +35 -17
  2. package/bin/install.js +389 -43
  3. package/package.json +17 -8
  4. package/skills/cometchat/SKILL.md +653 -50
  5. package/skills/cometchat-android-v5/SKILL.md +120 -0
  6. package/skills/cometchat-android-v5-components/SKILL.md +430 -0
  7. package/skills/cometchat-android-v5-core/SKILL.md +468 -0
  8. package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
  9. package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
  10. package/skills/cometchat-android-v5-features/SKILL.md +130 -0
  11. package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
  12. package/skills/cometchat-android-v5-production/SKILL.md +94 -0
  13. package/skills/cometchat-android-v5-push/SKILL.md +620 -0
  14. package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
  15. package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
  16. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
  17. package/skills/cometchat-android-v6/SKILL.md +107 -0
  18. package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
  19. package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
  20. package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
  21. package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
  22. package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
  23. package/skills/cometchat-android-v6-core/SKILL.md +354 -0
  24. package/skills/cometchat-android-v6-events/SKILL.md +212 -0
  25. package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
  26. package/skills/cometchat-android-v6-features/SKILL.md +130 -0
  27. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
  28. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
  29. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
  30. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
  31. package/skills/cometchat-android-v6-production/SKILL.md +187 -0
  32. package/skills/cometchat-android-v6-push/SKILL.md +274 -0
  33. package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
  34. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
  35. package/skills/cometchat-angular-components/SKILL.md +706 -0
  36. package/skills/cometchat-angular-core/SKILL.md +444 -0
  37. package/skills/cometchat-angular-customization/SKILL.md +424 -0
  38. package/skills/cometchat-angular-features/SKILL.md +447 -0
  39. package/skills/cometchat-angular-patterns/SKILL.md +447 -0
  40. package/skills/cometchat-angular-placement/SKILL.md +685 -0
  41. package/skills/cometchat-angular-production/SKILL.md +415 -0
  42. package/skills/cometchat-angular-theming/SKILL.md +365 -0
  43. package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
  44. package/skills/cometchat-astro-patterns/SKILL.md +3 -3
  45. package/skills/cometchat-components/SKILL.md +2 -0
  46. package/skills/cometchat-core/SKILL.md +11 -6
  47. package/skills/cometchat-customization/references/component-catalog.md +1 -1
  48. package/skills/cometchat-features/SKILL.md +176 -108
  49. package/skills/cometchat-flutter-v5/SKILL.md +167 -0
  50. package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
  51. package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
  52. package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
  53. package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
  54. package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
  55. package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
  56. package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
  57. package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
  58. package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
  59. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
  60. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
  61. package/skills/cometchat-flutter-v6/SKILL.md +445 -0
  62. package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
  63. package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
  64. package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
  65. package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
  66. package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
  67. package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
  68. package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
  69. package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
  70. package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
  71. package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
  72. package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
  73. package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
  74. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
  75. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
  76. package/skills/cometchat-ios/SKILL.md +323 -0
  77. package/skills/cometchat-ios-components/SKILL.md +651 -0
  78. package/skills/cometchat-ios-core/SKILL.md +822 -0
  79. package/skills/cometchat-ios-customization/SKILL.md +825 -0
  80. package/skills/cometchat-ios-features/SKILL.md +725 -0
  81. package/skills/cometchat-ios-placement/SKILL.md +750 -0
  82. package/skills/cometchat-ios-production/SKILL.md +730 -0
  83. package/skills/cometchat-ios-push/SKILL.md +582 -0
  84. package/skills/cometchat-ios-theming/SKILL.md +631 -0
  85. package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
  86. package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
  87. package/skills/cometchat-native-components/SKILL.md +594 -0
  88. package/skills/cometchat-native-core/SKILL.md +407 -0
  89. package/skills/cometchat-native-customization/SKILL.md +594 -0
  90. package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
  91. package/skills/cometchat-native-features/SKILL.md +608 -0
  92. package/skills/cometchat-native-placement/SKILL.md +500 -0
  93. package/skills/cometchat-native-production/SKILL.md +694 -0
  94. package/skills/cometchat-native-push/SKILL.md +593 -0
  95. package/skills/cometchat-native-testing/SKILL.md +583 -0
  96. package/skills/cometchat-native-theming/SKILL.md +656 -0
  97. package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
  98. package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
  99. package/skills/cometchat-react-router-patterns/SKILL.md +23 -21
@@ -0,0 +1,470 @@
1
+ ---
2
+ name: cometchat-native-bare-patterns
3
+ description: "Integration patterns for bare React Native CLI projects — pod install, Info.plist + AndroidManifest permissions, Apple privacy manifest, native module linking, Metro config."
4
+ license: "MIT"
5
+ compatibility: "Node.js >=18; React Native >=0.77; @cometchat/chat-uikit-react-native ^5"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory, AskUserQuestion"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "cometchat react-native bare cli pods native-modules privacy-manifest"
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ Teaches Claude how to integrate CometChat into a bare React Native CLI project. Covers:
16
+
17
+ - Installing the full peer-dependency set + native-module autolinking
18
+ - `pod install` cadence for iOS
19
+ - Editing `ios/<AppName>/Info.plist` for iOS permissions
20
+ - Editing `android/app/src/main/AndroidManifest.xml` for Android permissions
21
+ - Android-specific async-storage Maven repo gotcha
22
+ - **Apple privacy manifest** (`ios/<AppName>/PrivacyInfo.xcprivacy`) — required for App Store compliance
23
+ - Wiring `index.js` + `App.tsx` with the provider chain
24
+
25
+ **Read `cometchat-native-core` first** (init/login/wrapper chain + anti-patterns), then `cometchat-native-components`, then `cometchat-native-placement`.
26
+
27
+ Ground truth: `docs/ui-kit/react-native/react-native-cli-integration.mdx`, `apple-privacy-manifest-guide.mdx`, `react-native-conversation.mdx` + `react-native-one-to-one-chat.mdx` + `react-native-tab-based-chat.mdx`, and `examples/SampleApp/`.
28
+
29
+ ---
30
+
31
+ ## Use this skill when
32
+
33
+ - Project has `ios/` and `android/` folders at the root
34
+ - `package.json` `main` is `index.js` (classic RN entry)
35
+ - No `expo` in `package.json` dependencies
36
+ - User says "React Native CLI", "bare RN", "ejected Expo", or "custom native modules"
37
+
38
+ **Do NOT use this skill when:**
39
+ - Project has `expo` in dependencies + `app.json`/`app.config.js` → use `cometchat-native-expo-patterns`
40
+ - Project is Expo that's prebuilt into `ios/` + `android/` folders → this can go either way. If the user's workflow is "I edit app.json and run `expo prebuild`", stay on expo-patterns. If they've fully committed to bare (deleted `app.json`, edit `Info.plist` directly), this skill applies.
41
+
42
+ ---
43
+
44
+ ## Prerequisites
45
+
46
+ - Xcode 15+ for iOS (required for Apple privacy manifest)
47
+ - Android Studio with SDK 34+
48
+ - CocoaPods installed (`brew install cocoapods` on macOS)
49
+ - `react-native-cli` or `@react-native-community/cli` usable via `npx`
50
+ - React Native **>=0.77** — older versions may work but are not officially supported by the UI Kit
51
+
52
+ ---
53
+
54
+ ## Step 1 — Install dependencies
55
+
56
+ ```bash
57
+ # Core SDK + UI Kit
58
+ npm install @cometchat/chat-sdk-react-native
59
+ npm install @cometchat/chat-uikit-react-native
60
+
61
+ # Required peer deps (natively linked)
62
+ npm install \
63
+ @react-native-async-storage/async-storage \
64
+ @react-native-clipboard/clipboard \
65
+ @react-native-community/datetimepicker \
66
+ react-native-gesture-handler \
67
+ react-native-localize \
68
+ react-native-safe-area-context \
69
+ react-native-svg \
70
+ react-native-video
71
+
72
+ # dayjs + punycode — no native code but required
73
+ npm install dayjs punycode
74
+ ```
75
+
76
+ Bare RN uses autolinking, so no `react-native link` step is needed. Just confirm everything installed cleanly — if `npm install` errored mid-way, native modules won't be wired up correctly.
77
+
78
+ ### Optional — calling SDK
79
+
80
+ Only if the user's flow includes voice / video calls:
81
+
82
+ ```bash
83
+ npm install \
84
+ @cometchat/calls-sdk-react-native \
85
+ @react-native-community/netinfo \
86
+ react-native-background-timer \
87
+ react-native-callstats \
88
+ react-native-webrtc
89
+ ```
90
+
91
+ WebRTC bloats the binary. Skip until the user actually wants calls.
92
+
93
+ ---
94
+
95
+ ## Step 2 — iOS: pod install + Info.plist + PrivacyInfo
96
+
97
+ ### 2a. Pod install
98
+
99
+ After **every** `npm install` of a native module (including the initial install above), run:
100
+
101
+ ```bash
102
+ cd ios && pod install && cd ..
103
+ ```
104
+
105
+ Without this, Xcode will fail to build with "module not found" errors for native classes. The warning signs:
106
+
107
+ - `No such module 'RNGestureHandler'` during build
108
+ - `Undefined symbol: _OBJC_CLASS_$_RNCAsyncStorage` during linking
109
+ - Build succeeds but runtime crash: "TurboModuleRegistry.getEnforcing(...): 'RNAsyncStorage' could not be found"
110
+
111
+ If pod install fails, see `cometchat-native-troubleshooting` § iOS pod install failures.
112
+
113
+ ### 2b. Info.plist permissions
114
+
115
+ Open `ios/<AppName>/Info.plist` and add:
116
+
117
+ ```xml
118
+ <key>NSCameraUsageDescription</key>
119
+ <string>Allow camera access to send photos and make video calls</string>
120
+
121
+ <key>NSMicrophoneUsageDescription</key>
122
+ <string>Allow microphone access to send voice messages and make calls</string>
123
+
124
+ <key>NSPhotoLibraryUsageDescription</key>
125
+ <string>Allow photo library access to send photos</string>
126
+
127
+ <key>NSPhotoLibraryAddUsageDescription</key>
128
+ <string>Allow saving photos from chat to your library</string>
129
+ ```
130
+
131
+ **Permission-string best practice**: the `Usage` strings show in the system prompt when iOS asks the user for permission — write them as user-facing copy, not developer notes. `"Camera access for video calls"` is fine; `"for media upload"` isn't a real reason a user would accept.
132
+
133
+ **Merge, don't replace.** The user may have existing permission strings for other libraries — add only what's missing, don't wipe the file.
134
+
135
+ ### 2c. Apple Privacy Manifest — `PrivacyInfo.xcprivacy`
136
+
137
+ **Required for App Store submission since iOS SDK 17 / Xcode 15.** If it's missing or incomplete, App Store Connect rejects the upload.
138
+
139
+ Create `ios/<AppName>/PrivacyInfo.xcprivacy` with this exact content:
140
+
141
+ ```xml
142
+ <?xml version="1.0" encoding="UTF-8"?>
143
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
144
+ <plist version="1.0">
145
+ <dict>
146
+ <key>NSPrivacyAccessedAPITypes</key>
147
+ <array>
148
+ <dict>
149
+ <key>NSPrivacyAccessedAPIType</key>
150
+ <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
151
+ <key>NSPrivacyAccessedAPITypeReasons</key>
152
+ <array>
153
+ <string>C617.1</string>
154
+ </array>
155
+ </dict>
156
+ <dict>
157
+ <key>NSPrivacyAccessedAPIType</key>
158
+ <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
159
+ <key>NSPrivacyAccessedAPITypeReasons</key>
160
+ <array>
161
+ <string>CA92.1</string>
162
+ </array>
163
+ </dict>
164
+ <dict>
165
+ <key>NSPrivacyAccessedAPIType</key>
166
+ <string>NSPrivacyAccessedAPICategorySystemBootTime</string>
167
+ <key>NSPrivacyAccessedAPITypeReasons</key>
168
+ <array>
169
+ <string>35F9.1</string>
170
+ </array>
171
+ </dict>
172
+ </array>
173
+ <key>NSPrivacyCollectedDataTypes</key>
174
+ <array/>
175
+ <key>NSPrivacyTracking</key>
176
+ <false/>
177
+ </dict>
178
+ </plist>
179
+ ```
180
+
181
+ These 3 reason codes match what the kit's own `examples/SampleApp/ios/SampleApp/PrivacyInfo.xcprivacy` ships:
182
+
183
+ | API category | Reason code | What it's for |
184
+ |---|---|---|
185
+ | `NSPrivacyAccessedAPICategoryFileTimestamp` | `C617.1` | File-modified timestamps (RN bundler) |
186
+ | `NSPrivacyAccessedAPICategoryUserDefaults` | `CA92.1` | AsyncStorage (UserDefaults backend on iOS) |
187
+ | `NSPrivacyAccessedAPICategorySystemBootTime` | `35F9.1` | Uptime for scheduling (RN + video cache) |
188
+
189
+ > **Optional fourth entry:** if your app does explicit free-space checks before media uploads, add `NSPrivacyAccessedAPICategoryDiskSpace` / `E174.1` too. The kit's sample doesn't ship this entry, so it isn't required for a default integration.
190
+
191
+ After adding:
192
+
193
+ 1. Open `ios/<AppName>.xcworkspace` in Xcode
194
+ 2. Right-click the app folder in the navigator → "Add Files to \"\<AppName\>\""
195
+ 3. Select `PrivacyInfo.xcprivacy` — make sure "Add to targets: \<AppName\>" is checked
196
+ 4. Rebuild
197
+
198
+ **If the user already has a `PrivacyInfo.xcprivacy`**, merge the 4 API types into their existing `NSPrivacyAccessedAPITypes` array — don't replace the whole file.
199
+
200
+ ### 2d. Install pods after Info.plist / PrivacyInfo changes
201
+
202
+ ```bash
203
+ cd ios && pod install && cd ..
204
+ ```
205
+
206
+ ---
207
+
208
+ ## Step 3 — Android: AndroidManifest + Maven repo
209
+
210
+ ### 3a. AndroidManifest permissions
211
+
212
+ Open `android/app/src/main/AndroidManifest.xml` and add inside `<manifest>` (before `<application>`):
213
+
214
+ ```xml
215
+ <uses-permission android:name="android.permission.INTERNET" />
216
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
217
+ <uses-permission android:name="android.permission.CAMERA" />
218
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
219
+ <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
220
+ <uses-permission android:name="android.permission.VIBRATE" />
221
+
222
+ <!-- Android 12 and below -->
223
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
224
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
225
+
226
+ <!-- Android 13+ (API 33+) -->
227
+ <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
228
+ <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
229
+ <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
230
+ ```
231
+
232
+ **Merge, don't replace.** Keep the user's existing permissions for other libraries.
233
+
234
+ ### 3b. Android: async-storage Maven repo (REQUIRED)
235
+
236
+ `@react-native-async-storage/async-storage` v3+ ships a **local Maven artifact** that autolinking can't find by default. Without this fix, `./gradlew assembleDebug` fails with:
237
+
238
+ ```
239
+ Could not find :react-native-async-storage_async-storage: on any of the paths.
240
+ ```
241
+
242
+ Add the local Maven repo to `android/build.gradle`:
243
+
244
+ ```gradle
245
+ allprojects {
246
+ repositories {
247
+ google()
248
+ mavenCentral()
249
+ // Required for @react-native-async-storage/async-storage v3+
250
+ maven {
251
+ url = uri(project(":react-native-async-storage_async-storage").file("local_repo"))
252
+ }
253
+ }
254
+ }
255
+ ```
256
+
257
+ Without this fix, the whole Android build fails early. This is a UI Kit-specific gotcha because the kit pins async-storage v3+.
258
+
259
+ ### 3c. Android: Metro config for custom fonts or assets (if applicable)
260
+
261
+ If the project uses custom icon fonts or bundled assets, confirm `react-native.config.js` includes:
262
+
263
+ ```js
264
+ module.exports = {
265
+ assets: ["./src/assets/fonts/"], // only if the user has custom fonts
266
+ };
267
+ ```
268
+
269
+ Run `npx react-native-asset` to link. Not required for the UI Kit itself — only relevant if the user extends with custom icons.
270
+
271
+ ---
272
+
273
+ ## Step 4 — Wire `index.js` + `App.tsx` with the provider chain
274
+
275
+ ### 4a. `index.js` — gesture handler FIRST
276
+
277
+ ```js
278
+ // index.js
279
+ import "react-native-gesture-handler"; // MUST be the first import
280
+ import { AppRegistry } from "react-native";
281
+ import App from "./App";
282
+ import { name as appName } from "./app.json";
283
+
284
+ AppRegistry.registerComponent(appName, () => App);
285
+ ```
286
+
287
+ **The `react-native-gesture-handler` import must be line 1.** Not line 2. Not after React. Without it, swipe gestures on the composer and bottom sheets silently break — often only in release builds, which makes it hard to catch during development.
288
+
289
+ ### 4b. `App.tsx` — provider wrapper chain
290
+
291
+ ```tsx
292
+ // App.tsx
293
+ import React from "react";
294
+ import { GestureHandlerRootView } from "react-native-gesture-handler";
295
+ import { SafeAreaProvider } from "react-native-safe-area-context";
296
+ import { CometChatThemeProvider } from "@cometchat/chat-uikit-react-native";
297
+ import { CometChatProvider } from "./src/providers/CometChatProvider";
298
+ import { AppNavigator } from "./src/navigation/AppNavigator";
299
+ import Config from "react-native-config"; // or read from an env source
300
+
301
+ export default function App() {
302
+ return (
303
+ <GestureHandlerRootView style={{ flex: 1 }}>
304
+ <SafeAreaProvider>
305
+ <CometChatThemeProvider>
306
+ <CometChatProvider
307
+ appId={Config.COMETCHAT_APP_ID!}
308
+ region={Config.COMETCHAT_REGION!}
309
+ authKey={Config.COMETCHAT_AUTH_KEY!}
310
+ uid="cometchat-uid-1" // dev mode only
311
+ >
312
+ <AppNavigator />
313
+ </CometChatProvider>
314
+ </CometChatThemeProvider>
315
+ </SafeAreaProvider>
316
+ </GestureHandlerRootView>
317
+ );
318
+ }
319
+ ```
320
+
321
+ The `CometChatProvider` itself lives in `src/providers/CometChatProvider.tsx` per `cometchat-native-core` § 6 — reuse that implementation.
322
+
323
+ ---
324
+
325
+ ## Step 5 — Env vars
326
+
327
+ Bare RN has no built-in env var system. Pick one:
328
+
329
+ ### Option A — `react-native-config` (most common)
330
+
331
+ ```bash
332
+ npm install react-native-config
333
+ cd ios && pod install && cd ..
334
+ ```
335
+
336
+ Create `.env` at project root:
337
+
338
+ ```
339
+ COMETCHAT_APP_ID=your_app_id
340
+ COMETCHAT_REGION=us
341
+ COMETCHAT_AUTH_KEY=your_auth_key
342
+ ```
343
+
344
+ Read via:
345
+
346
+ ```tsx
347
+ import Config from "react-native-config";
348
+ const appId = Config.COMETCHAT_APP_ID;
349
+ ```
350
+
351
+ **iOS post-setup**: Xcode needs to know about the `.env` file. Either use `react-native-config`'s Xcode build-phase script (documented in its README) or create a `.xcconfig` file. Without this, `Config.*` returns `undefined` on iOS.
352
+
353
+ ### Option B — `babel-plugin-dotenv-import`
354
+
355
+ Simpler but less mature. Only if the user's already picked this.
356
+
357
+ ### Option C — hardcoded constants (NEVER for production)
358
+
359
+ For a quick dev-mode proof-of-concept only, just declare the values as constants in a dedicated config file:
360
+
361
+ ```ts
362
+ // src/config/cometchat.ts
363
+ export const CONFIG = {
364
+ APP_ID: "YOUR_APP_ID",
365
+ REGION: "us",
366
+ AUTH_KEY: "YOUR_AUTH_KEY",
367
+ };
368
+ ```
369
+
370
+ Add `src/config/cometchat.ts` to `.gitignore`. Obviously do not commit real credentials.
371
+
372
+ ### Never put `REST_API_KEY` in the client
373
+
374
+ The REST API key is server-only. Production user management + auth token minting happens on a backend you control — see `cometchat-native-production`.
375
+
376
+ ---
377
+
378
+ ## Step 6 — Run + verify
379
+
380
+ ### First run
381
+
382
+ ```bash
383
+ # iOS
384
+ npx react-native run-ios
385
+
386
+ # Android
387
+ npx react-native run-android
388
+ ```
389
+
390
+ First build takes several minutes. Subsequent runs with the Metro bundler already running are fast.
391
+
392
+ ### Verify
393
+
394
+ 1. `npx tsc --noEmit` — TypeScript check
395
+ 2. Open the chat screen in the simulator
396
+ 3. Tap the composer — keyboard should open smoothly
397
+ 4. Tap the "+" attachment button — action sheet should slide up (gesture handler)
398
+ 5. Send a message — it should appear immediately
399
+
400
+ If any of these fail, see `cometchat-native-troubleshooting`.
401
+
402
+ ### Re-run cadence
403
+
404
+ | Change | Command |
405
+ |---|---|
406
+ | JSX / TS changes | Fast Refresh handles it; `r` in Metro to reload |
407
+ | Added / removed a dep without native code | Restart Metro |
408
+ | Added / removed a native module | `cd ios && pod install && cd ..` then run-ios |
409
+ | Changed `Info.plist` | `run-ios` (Xcode picks up changes) |
410
+ | Changed `AndroidManifest.xml` | `run-android` |
411
+ | Changed `android/build.gradle` | `./gradlew clean` then `run-android` |
412
+
413
+ ---
414
+
415
+ ## Hard rules
416
+
417
+ 1. **`pod install` is mandatory after every native dep change.** Missing this → build fails with "module not found" or crashes at runtime with "TurboModuleRegistry could not find X".
418
+
419
+ 2. **`import "react-native-gesture-handler"` is the FIRST line of `index.js`.** Before React. Before any other import. Missing → swipe gestures silently break (often only in release builds).
420
+
421
+ 3. **Android requires the local Maven repo entry** for `@react-native-async-storage/async-storage` v3+ (see § 3b). Without it, the Android build fails at the assembly step.
422
+
423
+ 4. **The Apple Privacy Manifest is required for App Store submission.** Skip it and your app gets rejected. Either create `PrivacyInfo.xcprivacy` (§ 2c) or merge the 4 API types into an existing one.
424
+
425
+ 5. **Merge permissions into `Info.plist` and `AndroidManifest.xml`, don't replace.** Wiping out the user's existing permissions breaks their other features.
426
+
427
+ 6. **The four-wrapper chain is at the app root (`App.tsx`), not per-screen.** Re-wrapping per screen causes duplicate init + login, dropped WebSockets, and a 2-3 second flicker on first mount.
428
+
429
+ 7. **`REST_API_KEY` is never in the client.** Use an external backend for token minting — see `cometchat-native-production`.
430
+
431
+ 8. **Every `<CometChatMessageList>` must include `hideReplyInThreadOption`** unless you're wiring a full thread panel (see `cometchat-native-placement` § Hard rule 5).
432
+
433
+ ---
434
+
435
+ ## Common questions
436
+
437
+ **Q: "TurboModuleRegistry.getEnforcing(...): 'RNAsyncStorage' could not be found"**
438
+ Forgot `pod install`. Run `cd ios && pod install && cd ..` then rebuild.
439
+
440
+ **Q: Android build fails with "Could not find :react-native-async-storage_async-storage:"**
441
+ See § 3b — add the local Maven repo entry to `android/build.gradle`.
442
+
443
+ **Q: App Store rejected the build with "ITMS-91053: Missing API declaration"**
444
+ Apple Privacy Manifest is incomplete. Use the full 4-API-type declaration in § 2c.
445
+
446
+ **Q: Composer swipe gestures don't work in production**
447
+ `import "react-native-gesture-handler"` isn't the first line of `index.js`. Move it above all other imports.
448
+
449
+ **Q: `CometChatUIKit.login({uid: "..."})` resolves but components don't render**
450
+ You're probably rendering before `init()` completes. Gate rendering on `CometChatProvider`'s `isReady` state — see `cometchat-native-core` § 6.
451
+
452
+ **Q: I want to support Expo AND bare in the same codebase**
453
+ Use Expo + `npx expo prebuild` to generate native projects on demand. Stay on `cometchat-native-expo-patterns`.
454
+
455
+ ---
456
+
457
+ ## Skill routing reference
458
+
459
+ | Skill | When to route |
460
+ |---|---|
461
+ | `cometchat-native-core` | Init / login / wrapper chain / anti-patterns |
462
+ | `cometchat-native-components` | Component prop reference |
463
+ | `cometchat-native-placement` | Where chat goes (stack / tabs / modal / bottom sheet / embedded) |
464
+ | `cometchat-native-expo-patterns` | Expo managed workflow |
465
+ | `cometchat-native-bare-patterns` | This skill — bare RN CLI |
466
+ | `cometchat-native-features` | Calls, extensions, AI |
467
+ | `cometchat-native-theming` | Theme customization |
468
+ | `cometchat-native-customization` | Text formatters, events, custom views |
469
+ | `cometchat-native-production` | Server-side auth tokens + user management |
470
+ | `cometchat-native-troubleshooting` | pod install fails, build errors, missing modules, privacy manifest rejection |