Android Requirements
ASAPP supports Android 5.0 (API level 21) and up. The SDK currently targets API level 30. ASAPP distributes the library via a Maven repository and you can import it with Gradle. ASAPP wrote the SDK in Kotlin. You can also use it if you developed your application in Java.Getting Started
To get started with Android SDK, you need to:1. Gather Required Information
Before downloading and installing the SDK, please make sure you have the following information. Contact your Implementation Manager at ASAPP if you have any questions.App ID | Also known as the “Company Marker”, assigned by ASAPP. |
API Host Name | The fully-qualified domain name used by the SDK to communicate with ASAPP’s API. Provided by ASAPP and subject to change based on the stage of implementation. |
Region Code | The ISO 3166-1 alpha-2 code for the region of the implementation, provided by ASAPP. |
Supported Languages | Your app’s supported languages, in order of preference, as an array of language tag strings. Strings can be in the format “{ISO 639-1 Code}-{ISO 3166-1 Code}” or “{ISO 639-1 Code}”, such as “en-us” or “en”. Defaults to [“en”]. |
Client Secret | This can be an empty or random string* until otherwise notified by ASAPP. |
User Identifier | A username or similar value used to identify and authenticate the customer, provided by the Customer Company. |
Authentication Token | A password-equivalent value, which may or may not expire, used to authenticate the customer that is provided by the Customer Company. |
2. Install the SDK
ASAPP distributes the library via a Maven repository and you can import it with Gradle. First, add the ASAPP Maven repository to the top-levelbuild.gradle
file of your project:
implementation 'com.asapp.chatsdk:chat-sdk:<version>'
Please check the latest Chat SDK version in the repository or release notes.
At this point, sync and rebuild your project to make sure all dependencies are imported successfully. You can also validate the authenticity of the downloaded dependency by following these steps.
Validate Android SDK Authenticity
You can verify the authenticity of the SDK and make sure that ASAPP generated the binary. The GPG signature is the standard way ASAPP handles Java binaries when this is a requirement.Setup
First, download the ASAPP public key from here.Verify File Signature
Use the console GPG command to import the key:gpg --list-keys
.
Download the ASC file directly from our repository. Finally, you can verify the Chat SDK AAR and associated ASC files like so:
3. Configure the SDK
Use the code below to create a configuration, and initialize the SDK with it. You must pass yourApplication
instance.
Refer to the aforementioned required information. ASAPP recommends you initialize the SDK in your Application.onCreate
.
In case, you are facing compile issue after setting enableSDKCrashlytics to true, perform the following steps
- Add (if not present) the following plugins to your app module’s build.gradle.kts or build.gradle:
- id(“com.google.gms.google-services”)
- id(“com.google.firebase.crashlytics”)
- Add (if not present) the Firebase BOM to your app’s dependencies block:”
- implementation(platform(“com.google.firebase:firebase-bom:29.0.0”))
- Create a dummy google-services.json and place it in location: $APP_DIR/google-services.json.
The SDK should only be initialized once and it is possible to update the configuration at runtime.
4. Open Chat
Once the SDK has been configured and initialized, you can open chat. To do so, use theopenChat(context: Context)
function which will start a new Activity:
