Integrate the SDK to Your Project

Learn how to integrate the SDK into your Android project

Khoros will provide the following values needed during the SDK initialization and login.

  • Android Integration Id
  • API Key Id
  • API key Secret

The SDK will need to be installed using Gradle as a dependency from JitPack.

Provide Khoros with the GitHub username of the developer and Khoros will also grant them access to the Github repository which hosts the SDK, and JitPack which the SDK is published through.

Then, they can add the BrandMessenger to their Gradle dependency and sync to download the SDK.

First, add JitPack to repositories using the project-level build.gradle file.

allprojects {
    repositories {
        ...
        maven {
            url 'https://jitpack.io'
            credentials { username authToken }
        }
    }
}

📘

Regarding the authToken

The authToken is the developer's personal authToken for their jitpack.io access. They can login to jitpack, setup to use private repositories and retrieve their authToken from https://jitpack.io/private#auth.

The authToken should be stored in your gradle.properties file.

For example:

authToken= YOUR_AUTH_TOKEN

From v3.0.2, no need to add additional dependencies. Skip to last step on this page

Projects in which you wish to integrate the BrandMessenger SDK require the following additional dependencies (as of v3.0.1):

implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.okhttp3:okhttp:3.12.6'
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.google.dagger:dagger:2.25.2'
annotationProcessor 'com.google.dagger:dagger-compiler:2.25.2'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.exifinterface:exifinterface:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.media:media:1.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view3.10.0'

Next, add BrandMessenger core and UI as dependencies to your module-level build.gradle file.

dependencies {
    implementation 'com.github.lithiumtech.brand-messenger-android-sdk:core:<latest version available>'
    implementation 'com.github.lithiumtech.brand-messenger-android-sdk:ui:<latest version available>'
}

Finally, sync the project. You should now have Brand Messenger pulled into your project.


Did this page help you?