Integrate Amazon Connect chat into a mobile application - Amazon Connect

Integrate Amazon Connect chat into a mobile application

This topic explains how to build a custom Amazon Connect chat UI in your mobile application. This requires using your own chat back end. You must also use the Amazon Connect StartChatContact API to initiate contact, and use either the Amazon Connect Chat SDK for iOS or the Amazon Connect Chat SDK for Android to manage chat participation.

You can find examples on how to build your mobile chat UI powered by the Amazon Connect Chat SDKs in our UI Examples GitHub project.

Amazon Connect Chat SDKs for Mobile

The Amazon Connect Chat SDKs for iOS and Android simplify the integration of Amazon Connect chat for native mobile applications. The SDKs help handle client side chat logic and back-end communications similar to the Amazon Connect ChatJS Library.

The Amazon Connect Chat SDKs wrap the Amazon Connect Participant Service APIs and abstracts away the management of the chat session and WebSocket. This allows you to focus on the user interface and experience while relying on the Amazon Connect Chat SDK to interact with all the back-end services. This approach still requires you to use your own chat back end to call the Amazon Connect StartChatContact API to initiate contact.

For more information on the Swift-based iOS SDK, see the Amazon Connect Chat SDK for iOS GitHub page. For more information on the Kotlin-based Android SDK, see the Amazon Connect Chat SDK for Android GitHub page.

Amazon Connect chat integration workflow

The following diagram shows the programming flow between a customer using a mobile app and an agent. Numbered text in the diagram corresponds to numbered text below the image.

Diagram showing the Amazon Connect chat program flow.
In the diagram
  1. When a customer starts a chat in the mobile app, the app should send a request to Amazon Connect using the StartChatContact API. This requires specific parameters, such as the API endpoint and IDs for the instance and contact flow, to authenticate and initiate the chat.

  2. The StartChatContact API interacts with your back-end system to obtain a participant token and a contact ID that act as unique identifiers for the chat session.

  3. The app’s UI passes the StartChatContact response to the mobile SDK in order for the SDK to properly communicate with the Amazon Connect Participant Service and set up the customer’s chat session.

  4. The SDK will expose a chatSession object to the UI, which will contain easily usable methods to interact with the chat session.

  5. Under the hood, the SDK interacts with the Amazon Connect Participant Service using the AWS SDK. The communication with the Amazon Connect Participant Service is responsible for all customer interactions with the chat session. This includes actions such as CreateParticipantConnection, SendMessage, GetTranscript, or DisconnectParticipant.

  6. The SDK will also manage the websocket connection needed to receive messages, events and attachments from the agent. This will all be handled and parsed by the SDK and surfaced to the UI in an easily consumed structure

Getting started with Amazon Connect chat integration

The following steps and resources will help you get started with integrating Amazon Connect Chat into your native mobile applications:

  1. Check out the Amazon Connect Chat SDK for iOS and Amazon Connect Chat SDK for Android GitHub pages. The GitHub page will contain API documentation as well as an implementation guide that goes over any prerequisites and installation steps.

  2. Check out our Amazon Connect Chat UI Examples project and refer to our sample iOS and Android chat examples that showcase how to power a chat application using the Amazon Connect Chat SDK for iOS/Android.

  3. If there are any questions or issues regarding the set up or utilization of the Amazon Connect Chat SDK on your mobile applications, you can file an issue on either the Amazon Connect Chat SDK for iOS Issues page or the Amazon Connect Chat SDK for Android Issues page. If there is an issue with the mobile chat UI examples, you can file an issue on the Amazon Connect Chat UI Examples Issues page.