Mobile App

You can deploy DRUID chatbots in mobile applications by using the web chat channel (Direct Line) and enabling push notifications.

The diagram below shows the communication flow.

DRUID doesn't communicate directly with the mobile app. Instead, it securely connects through the DRUID Connector Host, which interacts with the mobile app's backend service, part of the client’s internal systems. The Connector Host transmits the conversation ID and any new or unread messages to ensure users receive notifications when chatting with the bot in the app. If the app is closed, new or unread messages are delivered via the app’s push notification system. Additionally, WebChat reports the number of read messages to the Conversational Engine through the DRUID bot API.

To deploy a bot in a mobile app, follow these steps:

Note:  Sending push notifications is available in DRUID 7.18 and higher. If you want to deploy a bot in a mobile app without sending push notifications, skip steps 1 to 3.

Step 1. Configure app and integration

  1. From the Solution Library, import solution Bot message notifications. The solution comes with a predefined app and integration.
  2. On the Solution Contents menu, click Apps and select the Message Notification app.
  3. Enter the Base URL of the mobile app's backend service.
  4. On the Solution Contents menu, click Integrations, then click on the Send message status notifications integration.
  5. Update the request with the mobile app's specific push notification endpoint and map the following mandatory MessageNotification fields: [[MessageNotification]].ConversationId, [[MessageNotification]].IncomingMessagesCount and [[MessageNotification]].LastMessageOn.
  6. Publish the integration.

Step 2. Enable bot API

Make sure the bot API is enabled to facilitate communication between the bot and the app for handling message notifications. To do this, go to the Administration menu and click on Settings. Then, select the Druid Bot API tab and check the Is Enabled option.

Step 3. Enable message notifications

  1. In the bot details, click the Channels tab
  2. Click on WebChat.
  3. Select Enable message notification.
  4. In the Message notification integration field, choose the integration you updated at Step 1.
  5. Click Save at the bottom of the page.

Step 4. Put the webchat snippet in the mobile app

  1. On the Channels tab, in the WebChat section, customize the web chat snippet parameters as needed. For more details, see WebChat Common Styling and Behavior.
  2. Copy the web chat snippet and add it to your mobile app.

Users can now interact with the bot directly from the mobile app.