Add Chat SDK to your project

Android X

Make sure you've added the following to your gradle.properties file:
android.useAndroidX=true
android.enableJetifier=true

Inherit from Chat SDK theme

The Chat SDK uses custom attributes so you need to make sure that your app inherits from the Chat SDK theme.
<style name="AppTheme" parent="ChatSDKTheme">

Add Gradle dependencies

Project-level build.gradle
buildscript {
dependencies {
classpath "com.google.gms:google-services:4.3.10"
...
}
...
}
​
allprojects {
repositories {
google()
mavenCentral()
​
maven { url 'https://jitpack.io' }
maven { url "https://chatsdk.jfrog.io/artifactory/release/chat-sdk-android" }
maven { url "https://chatsdk.jfrog.io/artifactory/release/chatkit" }
maven { url "https://chatsdk.jfrog.io/artifactory/release/matisse" }
maven { url "https://chatsdk.jfrog.io/artifactory/release/material-search-view" }
maven { url "https://chatsdk.jfrog.io/artifactory/release/android-image-cropper" }
}
}
App-level build.gradle
Enable multi-dex, Java 8 and the Google Services plugin:
apply plugin: 'com.google.gms.google-services'
​
android {
​
defaultConfig {
multiDexEnabled = true
...
}
​
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Then add the dependencies. Replace the [latest-version] with 5.4.2.
For a working example check:
Choose one of the following backends to use:
Firebase
implementation "sdk.chat:firebase-app:[latest-version]"
FireStream (beta)
implementation "sdk.chat:firestream-app:[latest-version]"
XMPP
implementation "sdk.chat:xmpp-app:[latest-version]"
Copy link
On this page