Skip to main content

Before Getting Started

Overview

Clix leverages Firebase Cloud Messaging (FCM) to deliver notifications efficiently. The goal is to ensure a smooth integration process and reliable delivery of push notifications to your app users.

Environment

  • Android API level 26 (Android 8.0) or later
  • Firebase account
Make sure you’ve completed the Firebase setup.If the setup is complete, the following items should be in place:
  • Make sure google-services.json is in your project directory.
  • Upload the Service Account Key file to the Clix console.
Clix CLI is an AI-powered assistant for quick and easy SDK setup. Use the install and doctor commands to automatically configure the required code and settings.

Install Clix CLI

Run Install Command

The install command checks for required files and configurations, then guides you through the installation process with interactive prompts.

Doctor Command

The clix doctor command verifies that your Clix SDK setup is correct and provides guidance on fixing any issues.

Setup Clix - Manual Installation

Integrate Firebase and Clix to manage and send notifications effectively from Clix console.
Sonatype Central release (latest by date)

1. Installation

Clix Android SDK supports installation only via Gradle (Kotlin DSL).
If you’re using the Gradle Version Catalog (libs.versions.toml), follow the steps below for more consistent dependency management.
  1. Add the version and library alias to gradle/libs.versions.toml (create the file if it doesn’t exist):
  1. (Optional) If you use a custom catalog file name, adjust the accessor accordingly. If you’re using the default (libs), no extra configuration is required.
  2. In your app module’s build.gradle.kts:
When Gradle generates accessors, hyphens (-) in the alias are converted to dots (.) resulting in libs.clix.android.sdk.

(Option 2) Without Version Catalog (Direct Declaration)

Add the following to your project’s settings.gradle.kts or build.gradle.kts:
Add the dependency to your app’s build.gradle.kts:
Lastly, add the plugin to your app’s build.gradle.kts:

2. Initialize Clix with Config

Add this code to your Application class. The endpoint and logLevel parameters are optional. If your project doesn’t have an Application class, refer to this link to add one.
Application.kt

3. Add Permission Code

Add this code to your Application class, right after the Clix.initialize code.
Application.kt
By default, autoRequestPermission is set to false, which means the app will not automatically request push notification permission.There are two options to implement the push notification permission flow:

(Option 1) Automatically request permission right after app launch

Simply set autoRequestPermission to true.
Application.kt

(Option 2) Manually control when to show the permission prompt

If you want to request permission at a specific point in your app, leave it as false and call the following code when you’re ready to request permission.
MainActivity.kt

4. Build & Run

Run your project to verify that the setup works correctly. Go to Clix console > Test Console, find the registered device, send a test push notification, and confirm that the message is received on the device. Also, make sure the push events are being tracked in real time.
If you’re using an emulator, make sure it is started with Cold Boot to properly test push notification delivery. For more details, see this guide.

Setup Firebase

You need to set up Firebase before you start integrating it into your project.

Clix Sample Project - Android

If you’d like to see a working example, check out our sample project.