Requirements

Learn about the requirements for the Kustomer Chat Android SDK.

This guide covers everything you need before you can install and use the Kustomer Chat Android SDK.

Android development requirements

The Kustomer Chat Android SDK requires the following:

Kustomer platform permissions

To work with the Kustomer Chat SDK, you'll need at least Administrator-level permission sets to create API keys and to access the chat settings for your Kustomer organization.

Kustomer API Key

The Kustomer Chat SDK requires an API key with the org.tracking role for your Kustomer organization.

You can manually generate an API key in your Kustomer Security settings.

Manually generate the API key

To generate the API key manually:

  1. Go to Settings in your Kustomer app, and select Security > API Keys > Add API Key.

  2. Enter a descriptive name for your API key. Set Roles to org.tracking and Expires (in days) to "No Expiration".

  3. Select Create to generate a new API Key. Save your API key in a secure location.

To learn more about Kustomer API keys, see API keys in the Kustomer Help Center.

Default Android permissions

The Kustomer Chat UI Android SDK includes the following permissions by default:

<!--Required to make network requests-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>

<!--Required to take a picture and send as an attachment over chat-->

<uses-permission android:name="android.permission.CAMERA"/>

<queries>
    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE" />
    </intent>
    <intent>
        <action android:name="android.intent.action.GET_CONTENT" />

        <data android:mimeType="*/*" />
    </intent>
    <intent>
        <action android:name="android.intent.action.SEND" />

        <data android:mimeType="*/*" />
    </intent>
</queries>

Optional: Remove permissions for attachments

You can remove the permission to request camera access if you don't allow taking pictures.

Use the following code to override the default permissions for CAMERA:

<uses-permission android:name="android.permission.CAMERA" tools:node="remove" />

Proguard rules

Starting from Kustomer Android Chat SDK v3.4.0, ProGuard rules are automatically packaged through consumer ProGuard files for release builds. These rules are fully compatible with Android Gradle Plugin v8.0+ which has R8 full mode enabled by default.

For earlier SDK versions, the rules provided below can be manually applied.

# Kustomer
-dontwarn com.kustomer.**
-keep class com.kustomer.** {
    *;
    <init>(...);
    static <clinit>();
}
-dontwarn org.slf4j.impl.StaticLoggerBinder
-dontwarn kotlinx.parcelize.Parcelize
# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

# PubNub
-dontwarn com.pubnub.**
-keep class com.pubnub.** { *; }

# Moshi
-keep class com.squareup.moshi.** { *; }
-keepclasseswithmembers class * {
    @com.squareup.moshi.JsonAdapter <fields>;
}
-keep @com.squareup.moshi.** class * { *; }

# Retrofit
# R8 full mode strips generic signatures from return types if not kept.
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>

# With R8 full mode generic signatures are stripped for classes that are not kept.
-keep,allowobfuscation,allowshrinking class retrofit2.Response

Additional Dexguard rules

If you are using Dexguard in your app, please make sure to include the following Dexguard rules along with our existing Proguard rules.

-keepresources drawable/ic_kus_*
-keepresources drawable/kus_*