Get Started

Before you get started: Make sure you have created a channel in OneTalk dashboard and obtain the APP_KEY_SECRET.

Configure and Initialize TapTalk.io Omnichannel Android SDK

Step 1: Install TapTalk.io SDK

To start, open your Android project and add the following repositories to your top-level build.gradle file.

build.gradle (project)
allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
        maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
    }
}

Then add the following dependency to your app-level build.gradle:

build.gradle (:app)
dependencies {
    implementation 'com.github.taptalk-io:taptalk.io-omnichannel-android:2.4.1'
}

You can check a more updated version release notes of the SDK here.

Note: In the app build.gradle file, make sure that your project is using supported Java 8 language features under the android tag like below

build.gradle (:app)
android {
    
    ...

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

Step 2: Initialize TapTalkLive

In order to use TapTalkLive SDK, you must first initialize a TapTalkLive instance by passing the CONTEXT, APP_KEY_SECRET, CLIENT_APP_ICON, and CLIENT_APP_NAME assigned to your application to the init method as a parameter. Generally, initialization is implemented in the Application class in your project.

Application.java
import io.taptalk.taptalklive.TapTalkLive;
import io.taptalk.taptalklive.Listener.TapTalkLiveListener;

...

TapTalkLive.init(
    CONTEXT, 
    APP_KEY_SECRET, 
    CLIENT_APP_ICON, 
    CLIENT_APP_NAME,
    new TapTalkLiveListener() {
        @Override
        public void onInitializationCompleted() {
            // Handle initialization success here
        }
        
        @Override
        public void onInitializationFailed(TTLErrorModel error) {
            // Handle initialization failure here
        }
    }
);

Parameters

CONTEXT (Context) application context APP_KEY_SECRET: (String) application key Secret CLIENT_APP_ICON: (int) drawable resource ID of your application's icon CLIENT_APP_NAME: (String) your application name tapTalkLiveListener: (TapTalkLiveListener) an interface to detect TapTalkLive Android SDK's delegates and callbacks

Note: A more complete implementation of TapTalkLiveListener callbacks can be seen in the Event Listeners page.

Step 3: Enable Chat Features

Please follow the steps in Enable Chat Features page to enable TapTalk.io's chat features, such as contact sync and sending media, document, and location messages.

Open TapTalk Omnichannel View

To open TapTalkLive's view UI for your application, you can use the openTapTalkLiveView method from the TapTalkLive class. This will open a homepage activity containing a list of available channels, the user's latest case, and QnA path.

YourActivity.java
TapTalkLive.openTapTalkLiveView(YourActivity.this);

openTapTalkLiveView will return true if opening the view is successful, and will return false if it fails due to incomplete initialization. TapTalkLive initialization might not be completed if the device is not connected to internet or an incorrect APP_KEY_SECRET parameter was provided.

Last updated