CometChat Android Demo app (built using CometChat Pro) is a fully functional messaging app capable of one-on-one (private) and group messaging. The app enables users to send text and multimedia messages like audio, video, images, documents.
Simply Clone the project from android-kotlin-chat-app repository and open in Android Studio. Build the Demo App and it will be ready to Run
To Run to sample App you have to do the following changes by Adding ApiKey and AppId
-
Open the Project in Android Mode in Android Studio
-
Go to Under java --> com\inscripts\cometchatpulse--> StringContract
-
Under class
StringContract.kt
go toclass
namedAppDetails
-
modify APP_ID and API_KEY with your own ApiKey and AppId
val APP_ID: String = "XXXXXXXXX"
val API_KEY: String = "XXXXXXXXX"
-
To Run the app you also need to include google-services.json from your firebase console ,To connect the app to
firebase follow the instruction below : -
To enable push notification in your app you also need to enable push notification extension in your app from CometChat DashBoard.To enable push notification extension follow the below steps:
- Go to your app in CometChat Dashboard
- Go to Extension section
- Add Push Notification Extension
- Add FCM Server Key in Push Notification Extension
You can Obtain your APP_ID and API_KEY from CometChat-Pulse Dashboard
For more information read CometChat-Pro Android SDK Documentation
We have provided three themes with our sample app namely PersianBlue, MountainMeadow, AzureRadiance. To apply the themes:
-
Go to
Application
classCometChatPro
-
Create constructor of class
Appearance
and pass any of these three values1.PERSIAN_BLUE
2.MOUNTAIN_MEADOW
3.AZURE_RADIANCE
example Appearance(Appearance.AppTheme.PERSIAN_BLUE)
To make your custom appearance go to Appearance
class under package named Utils i.e
Go to Under java --> com\inscripts\cometchatpulse--> Utils--> Appearance
Copy sample app in your project
remove login and add your own authentication method
launch MainActivity
and start using the app
Feel free to make Pull Request.