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.
- Add the Unified SDK and chosen product SDKs to your iOS project. See Adding the Unified SDK
- In the Zendesk Support admin interface, enable and configure the product SDKs that you want to use. 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 the Support Help Center
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 Mobile SDK admin page in Zendesk Support.
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
Any product SDK should be initialized in the AppDelegate file when your application is launched.
The following example initializes Answer Bot and Support:
Import the following frameworks into the AppDelegate file in your project.
import ZendeskCoreSDK import SupportProvidersSDK import AnswerBotProvidersSDK
#import <ZendeskCoreSDK/ZendeskCoreSDK.h> #import <SupportProvidersSDK/SupportProvidersSDK.h> #import <AnswerBotProvidersSDK/AnswerBotProvidersSDK.h>
Paste the following initialization code into the
Zendesk.initialize(appId: "appId", clientId: "clientId", zendeskUrl: "url") Support.initialize(withZendesk: Zendesk.instance) AnswerBot.initialize(withZendesk: Zendesk.instance, support: Support.instance!)
[ZDKZendesk initializeWithAppId: @"appId" clientId: @"clientId" zendeskUrl: @"url"]; [ZDKSupport initializeWithZendesk: [ZDKZendesk instance]]; [ZDKAnswerBot initializeWithZendesk:[ZDKZendesk 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.