Add Chat SDK to your project

Android X

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

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.
1
<style name="AppTheme" parent="ChatSDKTheme">
Copied!

Add Gradle dependencies

Project-level build.gradle
1
buildscript {
2
dependencies {
3
classpath "com.google.gms:google-services:4.3.3"
4
...
5
}
6
...
7
}
8
​
9
allprojects {
10
repositories {
11
google()
12
mavenCentral()
13
jcenter()
14
maven { url 'https://jitpack.io' }
15
maven { url "https://chatsdk.jfrog.io/artifactory/release/chat-sdk-android" }
16
maven { url "https://chatsdk.jfrog.io/artifactory/release/chatkit" }
17
maven { url "https://chatsdk.jfrog.io/artifactory/release/matisse" }
18
}
19
}
Copied!
App-level build.gradle
Enable multi-dex, Java 8 and the Google Services plugin:
1
apply plugin: 'com.google.gms.google-services'
2
​
3
android {
4
​
5
defaultConfig {
6
multiDexEnabled = true
7
...
8
}
9
​
10
compileOptions {
11
sourceCompatibility JavaVersion.VERSION_1_8
12
targetCompatibility JavaVersion.VERSION_1_8
13
}
14
}
Copied!
Then add the dependencies. Replace the [latest-version] with 5.3.11.
Choose one of the following backends to use:
Firebase
1
implementation "sdk.chat:firebase-app:[latest-version]"
Copied!
FireStream (beta)
1
implementation "sdk.chat:firestream-app:[latest-version]"
Copied!
XMPP
1
implementation "sdk.chat:xmpp-app:[latest-version]"
Copied!
Last modified 3mo ago
Copy link