AI Integration Quick Reference
AI Integration Quick Reference
Prerequisites
Get your credentials from the CometChat Dashboard:
- App ID
- Region
- Auth Key (for development)
Migrating from v3 to v4? Your existing v3 app can be migrated directly — no need to create a new app. Follow the installation steps below to upgrade to the latest version of v4.
Installation
async-storage at runtime but doesn’t declare it, so install it yourself:
No extra Gradle repository is needed. Async-storage 2.x autolinks like any native module, so the old
local_repo Maven entry in android/build.gradle is not required. The ^2.1.2 range is also what the Calls SDK declares, so the same install works if you add calling later.Voice & Video Calling (Optional)
v2.4+ onwards, calling functionality lives in a separate package. Install it only if you need voice/video:@react-native-async-storage/async-storage ^2.1.2 is the sixth, already installed above); unpinned latest majors fail with ERESOLVE. See Calls SDK setup for the full calling setup.
- Android
- iOS
Add permissions to your Add the CometChat Maven repository to your project-level Ensure
AndroidManifest.xml:build.gradle:minSdkVersion is at least 24 in the buildscript ext block. Keep the compileSdkVersion, targetSdkVersion and buildToolsVersion your React Native template sets; don’t lower them:Initialization
Theinit() method initializes the SDK and must be called before any other CometChat method. Call it once at app startup, typically in App.tsx.
- TypeScript
- JavaScript
APP_ID and APP_REGION with your credentials from the Dashboard.
Parameters
AppSettings Options
Presence Subscription
Choose how to subscribe to user presence (online/offline status):WebSocket Connection
By default, the SDK manages WebSocket connections automatically. To manage them manually:Next Steps
Authentication
Log in users with Auth Key or Auth Token
Send Messages
Send your first message