Initializing the Unified SDK dependencies (Required)

To use the Unified SDK, you must initialize the product SDKs you want to use. You must complete some prerequisites steps.

Prerequisites

and Configuring the SDK in Zendesk Support in Zendesk help

Obtaining the initialization details

You need the following information to initialize Answer Bot and 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.

Adding the initialization code

Any product SDK should be initialized in the AppDelegate file when your application is launched.

The following example initializes Answer Bot and Support:

  1. Import the following frameworks into the AppDelegate file in your project.

    Swift

    import ZendeskCoreSDKimport SupportProvidersSDKimport AnswerBotProvidersSDK

    Objective-C

    #import <ZendeskCoreSDK/ZendeskCoreSDK.h> #import <SupportProvidersSDK/SupportProvidersSDK.h> #import <AnswerBotProvidersSDK/AnswerBotProvidersSDK.h>
  2. Paste the following initialization code into the application: didFinishLaunchingWithOptions method.

    Swift

    Zendesk.initialize(appId: "appId", clientId: "clientId", zendeskUrl: "url")Support.initialize(withZendesk: Zendesk.instance)AnswerBot.initialize(withZendesk: Zendesk.instance, support: Support.instance!)

    Objective-C

    [ZDKClassicZendesk initializeWithAppId: @"appId"    clientId: @"clientId"    zendeskUrl: @"url"];[ZDKSupport initializeWithZendesk: [ZDKClassicZendesk instance]];[ZDKAnswerBot initializeWithZendesk:[ZDKClassicZendesk instance] support:[ZDKSupport instance]];

Replace the parameter placeholders with your initialization details.

This initializes the Support and Answer Bot SDK.

The next step is to set an identity. See Setting an identity for more details.