Get Started

Quick Start

TapTalk.io help you to implement real-time chat to any type of your client app with speed and efficiency. Our Android SDK provides you with various methods to initialize, configure, and build the chat from the client side - no server side implementation is required because our reliable infra management service is delivered with the SDK. This page presents a brief overview of the SDK’s structure and abilities, then lets you go through the preliminary steps of implementing the SDK in your own app.

Configure and Initialize TapTalk.io Android SDK

Step 1: Create a new application from your dashboard

1.Login to TapTalk.io Dashboard, then choose Development -> Apps.

  1. Click New App Button, input App Name and choose Platform, and then click Create New App Button.
  1. A pop-up dialog will be shown with provided App Key ID & App Key Secret

🚧

Note: Please remember to save your App Key ID & your App Key Secret because it will only be shown once and will be used in TapTalk.io initialization

Step 2: Install TapTalk.io SDK

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

allprojects {
   repositories {
      ...
      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:

dependencies {
   implementation 'com.github.taptalk-io:taptalk.io-android:1.1.3'
}

🚧

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

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

Step 3: Initialize TapTalk.io in your Application class.

In order to use TapTalk.io, you must first initialize a TapTalk instance by passing the APP_ID, APP_SECRET, APP_ICON, APP_BASE_URL, and IMPLEMENTATION_TYPE assigned to your application to the init method as a parameter. Generally, initialization is implemented in the Application class in your project.

🚧

Note: To get APP_BASE_URL you can follow our documentation on how to get Base URL on TapTalk.io.

TapTalk.init(
  CONTEXT, 
  APP_KEY_ID, 
  APP_KEY_SECRET,            
  APP_ICON, 
  APP_NAME, 
  APP_BASE_URL,            
  IMPLEMENTATION_TYPE, 
  tapListener);
TapTalk.init(
  CONTEXT, 
  APP_KEY_ID, 
  APP_KEY_SECRET,            
  APP_ICON, 
  APP_NAME, 
  APP_BASE_URL,            
  IMPLEMENTATION_TYPE, 
  tapListener)

📘

Parameters

CONTEXT (Context) application context
APP_ID: (String) application key ID
APP_SECRET: (String) application key Secret
APP_ICON: (int) drawable resource ID
APP_NAME: (String) your application name
APP_BASE_URL: (String) base API URL
IMPLEMENTATION_TYPE: (enum) found in TapTalk.TapTalkImplementationType, more detailed information below
tapListener: (TapListener) an interface to detect TapTalk Android SDK's delegates and callbacks

📘

IMPLEMENTATION_TYPE

TapTalk implementation consists of 3 types which are:

  • TapTalkImplementationTypeUI: used for implementation with only TapUI
  • TapTalkImplementationTypeCore: used for implementation with only TapCore
  • TapTalkImplementationTypeCombine: used for implementation with both of TapCore and TapUI combined

📘

Note: In the Event Listener page, you can find detailed information on the usages of TapTalk Android SDK's delegates and callbacks.

Step 4: Authenticate to TapTalk.io

In order to use the abilities of the Android SDK in your client app, a TapTalk instance must be initiated in each client app through user authentication with TapTalk.io server. An authenticated user account allows the instance to communicate and interact with the server. To authenticate your user with the server, follow the instructions in Authentication page.

Setup FileProvider in your application

To enable file transfer through chat messages, you need to define FileProvider in your application's AndroidManifest.xml file, under the <application> tag.

<application
    android:name=".YourApplication"
    ...>

    <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="${applicationId}.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/file_paths" />
    </provider>

</application>

Initialize Google Places API Key (Optional)

To enable location search result preview while sending location message, a Google Places API Key is required. To obtain the API key for your application, you can check the documentation provided by Google. To initialize, insert your obtained key using the initializeGooglePlacesApiKey() method.

TapTalk.initializeGooglePlacesApiKey(GOOGLE_PLACES_API_KEY);
TapTalk.initializeGooglePlacesApiKey(GOOGLE_PLACES_API_KEY)

Your key also needs to be defined in your application's AndroidManifest.xml file, under the <application> tag.

<application
    android:name=".YourApplication"
    ...>

    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="GOOGLE_PLACES_API_KEY" />

</application>

📘

Parameters

GOOGLE_PLACES_API_KEY: (String) Google Places API Key

Open Your First Room List

To open room list view, you can simply use the openRoomList() method in the TapUI class. Creating a user interface won't be necessary, because TapTalk.io have provided an integrated user interface to be used in your application. To use TapTalk.io's chat interface, simply initialize our TapUI method and you are good to go. For more information about TapUI and TapCore, please see TapUI and TapCore page. In this example, we will open the room list view directly in your application's MainActivity onCreate() method.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
      
    if (TapTalk.isAuthenticated()) {
        // Show room list if authentication is completed
        TapUI.getInstance().openRoomList(this);
    } else {
        // Authentication is required
    }
    finish();
}
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
      
    if (TapTalk.isAuthenticated()) {
        // Show room list if authentication is completed
        TapUI.getInstance().openRoomList(this)
    } else {
        // Authentication is required
    }
    finish()
}

📘

Note: For more information about Room List View for TapUI, please see Room List section.

Updated 6 months ago

Get Started


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.