Basic Setup to Test the Mobile SDK

As you integrate Digital Experience (Digital) chat into your mobile app, you may need to test certain features or functionality. This page explains the minimum setup required to let you start testing. Some of the tasks on this page require an administrator account in CXone Mpower. If you do not have an administrator account, you may need to work with your manager or a CXone Mpower representative.

Access to CXone Mpower is controlled by roles. Roles have individual permissions that allow users to access apps like an agent application, or create and manage things like a chat channel.

Prerequisites

  • Download the SDK package for your desired platform (AndroidThis link opens in a new window and iOSThis link opens in a new window).

  • Add dependencies for the maven coordinates. This is explained in the repository README files.

  • You or an administrator must have CXone Mpower access:

    • An agent account in CXone Mpower with the following ACD permissions:

    • A CXone Mpower administrator account with the following ACD permissions:

  • Identify your CXone Mpower deployment region and provide the environment code to your developer. Contact your Account Representative for more information.

CXone Mpower Setup

These steps must be performed in CXone Mpower with an administrator account.

  1. Set up a chat messaging channel.

  2. Find the channelId and brandId for your desired chat messaging channel.

    1. In CXone Mpower, click the app selector and select ACD.

    2. Go to DigitalPoints of Contact DigitalChat > locate your chat channel > Initialization & Test.

    3. Just before the closing script tag, locate the cxone declaration, which looks like this: cxone('chat', 'init', 1132, 'chat_6fed4507-8cf3-443a-87a5-820981d1752b');.

    4. Save the four-digit number, which is your brandId.

    5. Save the longer alphanumeric string, which is your channelId.

    6. Provide these IDs to your developer.

Complete Getting Started

These steps are performed by the developer.

  1. Work through the getting started content for the platform you're developing on. The repository README files (AndroidThis link opens in a new window iOSThis link opens in a new window) contain this getting started information. These help you set up the necessary dependencies and synchronize the SDK with your code editor. You can skip certain sections of the getting started, depending on your needs. For example, you can skip setting up any advanced features like OAuth or push notifications.

  2. Initialize the chat instance:

    • Android: Use Chatbuilder to provide your environment region, brandId, and channelId. You must also call connect() on the chat instance.

    • iOS: Use connect() to provide your environment region, brandId, and channelId.

  3. Set up logging to view any reported errors.

    The Android SDK provides a logger framework that forces the SDK to log to Logcat. You can also use the default Android logger. These are set up with ChatBuilder.

    The iOS SDK has the LogManager class to facilitate logging. You can also reference CXoneChatError to view all the errors that you may receive.

  4. Set up either single-threadClosed In a single-threaded app, each contact has one chat thread that handles any interaction they have with your organization. or multi-threadClosed In a multi-threaded app, contacts can create as many threads as they want to discuss new topics. These threads can be active at the same time. handling. A single thread setup may be simpler for testing purposes. Be sure to check the single-thread case studies in the both Android and iOS SDK repositories.

Testing Tips

Android

Keep in mind the following:

  • Follow the single-thread or multi-thread case studies and try to replicate sending a simple message. For multi-thread, try to also create a secondary thread and send a simple message to see if the thread updates with the new message.

  • If necessary, you can skip implementing a UI and focus on testing the exchange of messages.

  • ChatStateListener informs the application about any runtime exceptions, errors, or a state changes. You can reference CXOneException.kt and ChatStateListener.kt for more information. Be sure you test for any exceptions or errors.

  • Some exceptions or errors may result from something under your control like AuthorizationError or ServerCommunicationError. However, exceptions like InvalidStateException or InvalidParameterException indicate an error on your side.

iOS

  • Follow the single-thread or multi-thread case studies and try to replicate sending a simple message. For multi-thread, try to also create a secondary thread and send a simple message to see if the thread updates with the new message.

  • If necessary, you can skip implementing a UI and focus on testing the exchange of messages.