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.
* In the future, the ASAPP-provided client secret will be a string that authorizes the integrated SDK to call the ASAPP API in production. ASAPP recommends fetching this string from a server and storing it securely using Secure Storage; however, as it is one of many layers of security, you can hard-code the client secret.
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 you have successfully imported all dependencies. 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:
