Running the Chat engine

How the Chat engine works

The Chat engine offers a live chat experience between an agent and a customer. On startup it looks to see if a chat is ongoing and opens the chat if present. The engine has configuration options to enable and disable features like the pre-chat form for collecting visitor info. It also has an option to send and receive offline messages if no agents are online.

The engine presents this in a seamless conversational format. It sits on top of our Unified SDK, which supports handovers from the AnswerBot engine.

Starting the Chat engine

Running the engine by itself

To start the Chat engine by itself, pass your ChatEngine instance to the builder for the MessagingActivity as follows:

MessagingActivity.builder()
        .withEngines(ChatEngine.engine())
        .show(Context context, ChatConfiguration chatConfiguration);
Running the engine with other engines
Engine answerBotEngine = AnswerBotEngine.engine();
Engine supportEngine = SupportEngine.engine();
Engine chatEngine = ChatEngine.engine();

MessagingActivity.builder()
    .withEngines(answerBotEngine, chatEngine, supportEngine)
    .show(context, chatConfiguration);

Note: Place the answerBotEngine object before any other engines. This is important because the Unified SDK starts the first engine in the list and any subsequent engines are treated as potential contact options. Answer Bot can hand over to Support and Chat but no other engine can hand over to Answer Bot. This means answerBotEngine must be placed first in the list or else it will never be started.

Using the Chat API providers

An in-depth look at the Chat API Providers can be found here.