cometchat-native-bare-patterns
Integration patterns for bare React Native CLI projects — pod install, Info.plist + AndroidManifest permissions, Apple privacy manifest, native module linking, Metro config.
cometchat · AI review on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add cometchat/cometchat-skills --skill cometchat-native-bare-patternsAbout this skill
name: cometchat-native-bare-patterns description: "Integration patterns for bare React Native CLI projects — pod install, Info.plist + AndroidManifest permissions, Apple privacy manifest, native module linking, Metro config." license: "MIT" compatibility: "Node.js >=18; React Native >=0.77; @cometchat/chat-uikit-react-native ^5" allowed-tools: "executeBash, readFile, fileSearch, listDirectory, AskUserQuestion" metadata: author: "CometChat" version: "3.0.0" tags: "cometchat react-native bare cli pods native-modules privacy-manifest"
Purpose
Teaches Claude how to integrate CometChat into a bare React Native CLI project. Covers:
- Installing the full peer-dependency set + native-module autolinking
pod installcadence for iOS- Editing
ios/<AppName>/Info.plistfor iOS permissions - Editing
android/app/src/main/AndroidManifest.xmlfor Android permissions - Android-specific async-storage Maven repo gotcha
- Apple privacy manifest (
ios/<AppName>/PrivacyInfo.xcprivacy) — required for App Store compliance - Wiring
index.js+App.tsxwith the provider chain
Read cometchat-native-core first (init/login/wrapper chain + anti-patterns), then cometchat-native-components, then cometchat-native-placement.
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/.
Use this skill when
- Project has
ios/andandroid/folders at the root package.jsonmainisindex.js(classic RN entry)- No
expoinpackage.jsondependencies - User says "React Native CLI", "bare RN", "ejected Expo", or "custom native modules"
Do NOT use this skill when:
- Project has
expoin dependencies +app.json/app.config.js→ usecometchat-native-expo-patterns - 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 runexpo prebuild", stay on expo-patterns. If they've fully committed to bare (deletedapp.json, editInfo.plistdirectly), this skill applies.
Prerequisites
- Xcode 15+ for iOS (required for Apple privacy manifest)
- Android Studio with SDK 34+
- CocoaPods installed (
brew install cocoapodson macOS) react-native-clior@react-native-community/cliusable vianpx- React Native >=0.77 — older versions may work but are not officially supported by the UI Kit
Step 1 — Install dependencies
# Core SDK + UI Kit
npm install @cometchat/chat-sdk-react-native
npm install @cometchat/chat-uikit-react-native
# Required peer deps (natively linked)
npm install \
@react-native-async-storage/async-storage \
@react-native-clipboard/clipboard \
@react-native-community/datetimepicker \
react-native-gesture-handler \
react-native-localize \
react-native-safe-area-context \
react-native-svg \
react-native-video
# dayjs + punycode — no native code but required
npm install dayjs punycode
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.
Optional — calling SDK
Only if the user's flow includes voice / video calls:
npm install \
@cometchat/calls-sdk-react-native \
@react-native-community/netinfo \
react-native-background-timer \
react-native-callstats \
react-native-webrtc
WebRTC bloats the binary. Skip until the user actually wants calls.
Step 2 — iOS: pod install + Info.plist + PrivacyInfo
2a. Pod install
After every npm install of a native module (including the initial install above), run:
cd ios && pod install && cd ..
Without this, Xcode will fail to build with "module not found" errors for native classes. The warning signs:
No such module 'RNGestureHandler'during buildUndefined symbol: _OBJC_CLASS_$_RNCAsyncStorageduring linking- Build succeeds but runtime crash: "TurboModuleRegistry.getEnforcing(...): 'RNAsyncStorage' could not be found"
If pod install fails, see cometchat-native-troubleshooting § iOS pod install failures.
2b. Info.plist permissions
Open ios/<AppName>/Info.plist and add:
<key>NSCameraUsageDescription</key>
<string>Allow camera access to send photos and make video calls</string>
<key>NSMicrophoneUsageDescription</key>
<string>Allow microphone access to send voice messages and make calls</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Allow photo library access to send photos</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Allow saving photos from chat to your library</string>
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.
Merge, don't replace. The user may have existing permission strings for other libraries — add only what's missing, don't wipe the file.
2c. Apple Privacy Manifest — PrivacyInfo.xcprivacy
Required for App Store submission since iOS SDK 17 / Xcode 15. If it's missing or incomplete, App Store Connect rejects the upload.
Create ios/<AppName>/PrivacyInfo.xcprivacy with this exact content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
Read the complete source ↗