Support SDK in a nutshell

This page gives you the basic steps for getting up and running with the Support SDK.

The SDK has the following requirements:

  • Minimum Android version: API level 21 (Lollipop/5.0)

What is the Support SDK?

The Support SDK helps you add the following features to your app:

  • Show all or some of the content in your help center
  • Search the content in your help center
  • Show open requests
  • Create requests
  • Update requests

You can customize the colors and fonts of the user interface with the Support SDK for all of these features. See Customize the look.

You can also use the Support SDK without our UI, and build your own UI on top of our API providers. This takes a little more development time but gives you more control. To find out more, see API providers.

To see some examples of different ways to use the Zendesk mobile SDKs, view our sample apps repo on Github.

What you need to get started

Getting up and running

  1. Add the SDK to your project by including the following snippets in the build.gradle file:

    // Note: This is the root-level repositories container, not the one under 'buildScript'
    repositories {	maven { url 'https://zendesk.jfrog.io/zendesk/repo' }}...dependencies {	implementation group: 'com.zendesk', name: 'support', version: '5.1.2'}

    For details, see Adding the Support SDK.

  2. Initialize Zendesk in the onCreate() method of an Activity where you plan to use the SDK, or an Application subclass. Use the initialization details provided by the Zendesk Support admin and a Context (highlighted):

    @Overridepublic void onCreate() {  super.onCreate();
      Zendesk.INSTANCE.init(this, "zendeskUrl", "appId", "clientId");
      Identity identity = new AnonymousIdentity();  Zendesk.INSTANCE.setIdentity(identity);
      Support.INSTANCE.init(Zendesk.INSTANCE);}

    Note: If you're using multiple brands you can use a brand subdomain rather than the primary subdomain in the zendeskUrl in the code above. Keep in mind that the end user will only be able to view tickets that belong to that brand.

  3. Create an identity (highlighted) so the app can authenticate as a Zendesk Support user, and set this on the Zendesk singleton:

    @Overridepublic void onCreate() {  super.onCreate();
      Zendesk.INSTANCE.init(this, "zendeskUrl", "appId", "clientId");
      Identity identity = new AnonymousIdentity();  Zendesk.INSTANCE.setIdentity(identity);
      Support.INSTANCE.init(Zendesk.INSTANCE);}

    There are two types of identity: anonymous and JWT. For details, see Setting an identity.

  4. Initialize the Support SDK using the Zendesk singleton you just initialized:

    @Overridepublic void onCreate() {  super.onCreate();
      Zendesk.INSTANCE.init(this, "zendeskUrl", "appId", "clientId");
      Identity identity = new AnonymousIdentity();  Zendesk.INSTANCE.setIdentity(identity);
      Support.INSTANCE.init(Zendesk.INSTANCE);}

The Support SDK is now initialized and ready to be used.

Launching the Support SDK UI

The Support SDK provides four Activity classes:

  • HelpCenterActivity,
  • ViewArticleActivity
  • RequestActivity
  • RequestListActivity.

Each of these has a static builder method you can use to start the activity. Example:

RequestActivity.builder()    .show(context);

You can use the builder object to configure the activity before starting it. Example:

RequestActivity.builder()    .withRequestSubject("Testing Support SDK")    .withTags("sdk", "android")    .show(context);

The builder can also return an Intent for the configured activity, to be started later. This is handy for PendingIntents and other asynchronous events. Example:

Intent requestActivityIntent = RequestActivity.builder()    .withRequestSubject("Testing Support SDK")    .withTags("sdk", "android")    .intent(context);

You can even pass one activity's Configuration to another activity, to be applied if one of them starts the other. For details, see Configuring the SDK activities.

To learn more, see Adding your help center, Adding Tickets, and the Activity builder reference.

For comprehensive reference documentation, see the Support SDK Javadocs on Github.