Initializing the Unified SDK dependencies (Required)
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
- 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 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:
-
Import the following frameworks into the AppDelegate file in your project.
Swift
import ZendeskCoreSDK
import SupportProvidersSDK
import AnswerBotProvidersSDK
Objective-C
#import <ZendeskCoreSDK/ZendeskCoreSDK.h>
#import <SupportProvidersSDK/SupportProvidersSDK.h>
#import <AnswerBotProvidersSDK/AnswerBotProvidersSDK.h>
-
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.