Initializing the Unified SDK dependencies (Required)

To use the MessagingSDK, you must first initialize the relevant product SDKs.

Initialize Support

Prerequisites

  • Add the MessagingSDK and the Support SDKs to your Android project. See

Adding the Unified SDK

Obtain the initialization details

You need the following information to initialize Support:

  • the URL of your Zendesk Support instance
  • your app's ID in Zendesk Support
  • the client ID of your app in Zendesk Support

These details are found on the Channels page in Admin Center.

If you have access to Admin Center, sign in and go to Channels > Classic > Mobile SDK. If you don't have admin access, ask a Zendesk admin to get the information for you.

If your organization's help center has a host-mapped address, then use the host-mapped URL instead of the Zendesk URL.

Add the initialization code

You should initialize the Support SDK in the onCreate method of your Application subclass, or in an Activity when your application is launched.

  1. Import the Zendesk and Support classes:

    import zendesk.core.Zendesk;import zendesk.support.Support;
  2. Call the init methods on the SDK classes:

    String zendeskUrl = ... // replace with your Zendesk account detailsString appId = ...      // replace with your Zendesk account detailsString clientId = ...   // replace with your Zendesk account details
    Zendesk.INSTANCE.init(context, zendeskUrl, appId, clientId);Support.INSTANCE.init(Zendesk.INSTANCE);

This initializes the Support SDK.

The next step is to identify your users. See Identify your users for more details.

If you've already done this, see Support engine for instructions on starting the MessagingActivity with an instance of SupportEngine.

Initialize Answer Bot

Prerequisites

  • The Answer Bot SDK uses Help Center, which is a part of the Support SDK. So to initialize

Answer Bot, you must first initialize Support. Follow the instructions in Initialize Support.

  • Enable Answer Bot on the Mobile SDK admin page in Zendesk Support. If you don't have admin access, ask a Zendesk admin to do it for you.

Add the initialization code

You should initialize the Answer Bot SDK directly after initializing the Support SDK.

  1. Import the AnswerBot class:

    import zendesk.answerbot.AnswerBot;
  2. Call the init method, using the Zendesk and Support instances:

    AnswerBot.INSTANCE.init(Zendesk.INSTANCE, Support.INSTANCE);

If you haven't already identified your user, make sure to do that now. See Identify your users for details.

If you've already done this, see Answer Bot engine for instructions on starting the MessagingActivity with an instance of AnswerBotEngine.