DTChat / Mobile App Integration (WebView)


Integrating DTChat with mobile apps

This document specifies how to integrate the Direct Talk chat system (DTChat) with applications developed for mobile platforms.

We will use the WebView feature to open the chat interface from the application.

Webview

Calling DTChat via WebView is simple. The WebView component will open the same URL opened by the website for DTChat.

Points of attention in relation to the consumer experience through this model of service via application:

  • If there is a queue the customers will have to wait for an available operator;
  • You will not be able to send messages before or after business hours;
  • The application (DTChat) needs to be in the foreground or the session attendance may be terminated by the server.

Implementation

Adding a WebView in the application. Let’s take as an example for the ANDROID plataform, just to illustrate the implementation, however, the same model can be applied in other platforms as well.

To add a WebView in the application we must include the component in the application’s layout. For example:

<?xml version="1.0" encoding="utf-8"?>
<WebView  xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/webview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
/>

To load the WebView we use loadUrl(). For example:

WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("https://wwwXX.directtalk.com.br/chat31/?idd=88D30000000000000000");

IMPORTANT: The URL for publication can be obtained in the Supervisor Module, at the department you want to trigger. Access “Configurações” -> “DTChat” -> “URL ou botão de atendimento”. Click here to learn more.

We remind you that the application should have access to the Internet. To ensure access to the internet ask for permission on the manifest file.
For example:

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

We also need to ensure that JavaScript is enabled on WebView. Please note that JavaScript is disabled by default in WebView component. We can enable it through WebSettings. For example:

WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);

Use in the call center

Customer service on mobile devices will be seamlessly integrated with the DTChat system, simplifying deployment and reducing costs. For mobile calls it will be possible to:

  • Have the same reports and monitoring tools;
  • Have specific reports and indicators;
  • Distribute the calls to the attendants in an intelligent way, sharing attendants with calls via chat on the website.