Skip to content

Latest commit

 

History

History

sample-app-kotlin+push-notification

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

CometChat

Android Sample App with Push Notifications for Kotlin by CometChat

This is a reference application showcasing the integration of CometChat's Android UI Kit in a native Android application using Kotlin. It demonstrates how to implement real-time messaging and voice/video calling features with ease.

Prerequisites

  • Ensure you have the following installed:

    • Android Studio (latest stable version)
    • Java Development Kit (JDK 8 or later)
  • Sign up for a CometChat account to obtain your app credentials: App ID, Region, and Auth Key

Installation

  1. Clone the repository:

    git clone https://github.com/cometchat/cometchat-uikit-android.git
  2. Checkout v5 branch:

    git checkout v5
  3. Sync Gradle to ensure all dependencies are downloaded.

  4. [Optional] Enter your CometChat App ID, Region, and Auth Key in the AppCredentials.java file: file:

    object AppCredentials {
    const val APP_ID: String = ""
    const val AUTH_KEY: String = ""
    const val REGION: String = ""
    }

  5. Set up Firebase Cloud Messaging (FCM):

    • Go to the Firebase Console and create a project.
    • Add your Android app to the Firebase project and download the google-services.json file.
    • Place the google-services.json file in the sample-app-kotlin+push-notification/ directory of your project.
  6. Set up CometChat Push Notification:

    • Go to the Notification Documentation and follow integration steps.
    • Note the provider id entered while configuring the Push Notifications in CometChat Dashboard.
  7. Update the provider id from the step 7 in AppConstants.kt file:

    object FCMConstants {
    const val PROVIDER_ID: String = "provider-id" // As set in CometChat dashboard for push notifications
    const val KEY_UID: String = "UID"

  8. In the Android Studio toolbar, select the sample-app-kotlin+push-notification module from the module dropdown and run the project using an emulator or a physical device

Help and Support

For issues running the project or integrating with our UI Kits, consult our documentation or create a support ticket. You can also access real-time support via the CometChat Dashboard.