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
CometChatCalls
class wherever you want to use CometChatCalls
.
- JavaScript
- TypeScript
Calling Component Configuration
For@cometchat-pro/react-native-calls
version starting 3.0.0, please make sure you add the following additional dependencies & permissions.
- JSON
Permissions:
Android:- XML
- XML
Android:
Also in the same file inbuildscript
section in ext
block make sure you have set minSdkVersion to 24.
- build.gradle
iOS:
Please update the minimum target version in the Podfile. Goto ./ios folder and open the Podfile. In the Podfile update the platform version to12.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 index.js
file.
- JavaScript
- TypeScript
APP_ID
with your CometChat AppID
and REGION
with your App Region in the above code.
Parameter | Description |
---|---|
callAppSettings | An object of the CallAppSettings class |