build.gradle
file in the repositories
block under the allprojects
section:
build.gradle
file in the dependencies
section.
implementation 'com.cometchat:calls-sdk-android:4.1.0'
in the dependencies section of the app-level build.gradle
file.android
section of the app level gradle file.
init()
method initialises the settings required for CometChat. The init()
method takes the below parameters:
setRegion()
method.AppSettings
class allows you to configure three settings:
init()
method on app startup.
Parameter | Description |
---|---|
this | Android context for your application |
appID | CometChat App ID |
appSetting | An object of the AppSettings class. |
App State | Behaviour |
---|---|
App in foreground | Connected with WebSocket |
App in background | Immediately disconnected with WebSocket |
App State | Behaviour |
---|---|
App in foreground | Call CometChat.connect() to create the WebSocket connection |
App in background | Disconnect the WebSocket connection if no ping is received within 30 seconds after the app goes in the background. |