App ID
, AuthKey
, and Region
of your CometChat application when initializing the SDK.
i. Register on CometChat
settings.gradle
file and add the following repository URL in the repositories
block under the repositories
section.
build.gradle
file and add your package name as indicated in the code.
build.gradle
file and add the following dependency to fetch the chat UI kit into your project.
UIKitSettings
Class. It is intended for use primarily during proof-of-concept (POC) development or in the early stages of application development. You can use Auth Token method to login securely.Make sure to replace the APP_ID with your CometChat appId, AUTH_KEY with your CometChat app auth key and REGION with your app region in the above code.
UID
. You can create your own users on the CometChat Dashboard or via API. We have pre-generated test users: cometchat-uid-1
, cometchat-uid-2
, cometchat-uid-3
, cometchat-uid-4
, cometchat-uid-5
.
The login()
method returns the User object containing all the information of the logged-in user.
It will be easier for you to open a new activity upon successful login.
layout_activity.xml
file:
It will automatically fetch the conversation data upon loading the list. If the conversation list is empty, you can start a new conversation.