Initializing the Unified SDK dependencies (Required)
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
- Enable and configure a Support SDK app in the Zendesk Support admin interface. If you don't have admin access, ask a Zendesk admin to do it for you. See Registering the mobile app in Zendesk Support and Configuring the SDK in Zendesk Support in Zendesk help.
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.
-
Import the
Zendesk
andSupport
classes:import zendesk.core.Zendesk;
import zendesk.support.Support;
-
Call the
init
methods on the SDK classes:String zendeskUrl = ... // replace with your Zendesk account details
String appId = ... // replace with your Zendesk account details
String 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.
-
Import the
AnswerBot
class:import zendesk.answerbot.AnswerBot;
-
Call the
init
method, using theZendesk
andSupport
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
.