Initializing the Support SDK (Required)

You can initialize the Support SDK in your Application subclass, in an Activity, or anywhere you have access to a Context. Zendesk recommends initializing as early as possible, such as at application start time.

Prerequisites

Getting the initialization settings

You need the following information to initialize the SDK:

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

The settings were generated in Zendesk Support when the Zendesk admin registered your app:

init settings

If you have admin access to Zendesk Support, sign in and go to Admin > 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.

Adding the initialization code

  • Paste the following code snippet in the onCreate() method of the Application subclass or Activity:

    Zendesk.INSTANCE.init(this, "zendeskUrl",
        "appId", "clientId");
    
    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.

    This initializes Zendesk and the Support SDK.

    Next you need to set an identity. See Setting an identity for more details.