./android
folder and open project-level build Gradle file and add all repository URLs in the repositories
block under the allprojects
section.
24
. You can update the minSDKVersion in the variables.gradle
file located in the android
folder.
ios/App
folder and run pod install
this will create an App.xcworkspace
open this and run the app.
init()
method initialises the settings required for CometChat. The init()
method takes the below parameters:
setRegion()
method.AppSettings
class allows you to configure two settings:
true
informs the SDK to manage the web-socket connection internally. If set to false
, it informs the SDK that the web-socket connection will be managed manually. The default value for this parameter is true. For more information on this, please check the Managing connections manuallysection. The default value for this property is true.init()
before calling any other method from CometChat. We suggest you call the init()
method on app startup, preferably in the index.js
file.
APP_ID
with your CometChat App ID and REGION
with your App Region in the above code.
createUser()
method. This method takes a User
object and the Auth Key
as input parameters and returns the created User
object if the request is successful.
UID
and name
are specified as these are mandatory fields to create a user.
Once you have created the user successfully, you will need to log the user into CometChat using the login()
method.
We recommend you call the CometChat login()
method once your user logs into your app. The login()
method needs to be called only once.
AUTH_KEY
with your CometChat Auth Key in the above code.
cometchat-uid-1
, cometchat-uid-2
, cometchat-uid-3
, cometchat-uid-4
and cometchat-uid-5
.login()
method returns the User
object containing all the information of the logged-in user.