Quick Reference - Install and initialize the Calls SDK:
Get your Application Keys
Signup for CometChat and then:- Create a new app
- Head over to the API & Auth Keys section and note the Auth Key, App ID & Region
Add the CometChatCalls Dependency
Install the package as NPM module:- npm
- yarn
- package.json
Permissions
If you’re using Expo, please refer to the Expo Integration Guide for setting up permissions.
Android
You need to add the below in your App’sAndroidManifest.xml file.
- AndroidManifest.xml
buildscript section in ext block make sure you have set minSdkVersion to 24.
- build.gradle
iOS
You need to add the below in your App’sInfo.plist file.
- Info.plist
./ios folder and open the Podfile. In the Podfile update the platform version to 12.0.
- Podfile
ios/App folder and run pod install this will create an App.xcworkspace open this and run the app.
Initialize CometChatCalls
The init() method initialises the settings required for CometChatCalls. The init() method takes a single paramater, that is the instance of CallAppSettingsBuilder class. TheCallAppSettings class allows you to configure three settings:
- App ID: CometChat app ID.
- Region: The region where you app was created.
- Host(host: string): This method takes the client URL as input and uses this client URL instead of the default client URL. This can be used in case of dedicated deployment of CometChat.
init() before calling any other method from CometChatCalls. We suggest you call the init() method on app startup, preferably in the App.tsx file.
- JavaScript
- TypeScript
| Parameter | Description |
|---|---|
callAppSettings | An object of the CallAppSettings class |
Best Practices
Best Practices
- Initialize
CometChatCallsright afterCometChat.init()on app startup - Always call
CometChatCalls.init()before using any calling methods - Request camera and microphone permissions at runtime before initiating calls
- Use the correct
netinfoversion based on your React Native version (0.63+ vs below) - Run
pod installafter adding dependencies to ensure iOS native modules are linked
Troubleshooting
Troubleshooting
- Initialization fails: Verify your App ID and Region match the values in your CometChat Dashboard
- Android build fails: Ensure
minSdkVersionis set to 24 or higher inbuild.gradle - iOS build fails: Run
pod installin theiosdirectory and open the.xcworkspacefile (not.xcodeproj) - Permission denied errors: Confirm camera and microphone permissions are declared in
AndroidManifest.xmlandInfo.plist - Module not found: Make sure all required peer dependencies are installed — check the dependency list above