Support SDK for iOS in a nutshell

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

What you need

  • Your organization has a Zendesk Support account. You can register to start a free trial.

  • A Zendesk admin has registered your iOS app in Zendesk Support. See Registering the mobile app in Zendesk Support in the Support Help Center

  • The Zendesk admin has provided you with the initialization code for the app. The code was generated in Zendesk Support when the admin registered the app

  • The features you want to use are included in your Zendesk Support plan. See the breakdown of features and limitations per plan.

Getting up and running

  1. Add the SDK to your project.

    For details, see Adding the Support SDK.

  2. Initialize the SDK in the AppDelegate file of your project. This is a two-step process. First, you initialize the Core SDK, then you initialize the Support SDK.

    Swift

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

    Objective-C

    [ZDKZendesk initializeWithAppId:"appId" clientId:"clientId" zendeskUrl:"url"];
    [ZDKSupport initializeWithZendesk:[ZDKZendesk 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.

  3. Create an identity so the app can authenticate as a Zendesk Support user, then set it on the Zendesk singleton:

    Swift

    let ident = Identity.createAnonymous()
    Zendesk.instance?.setIdentity(ident)
    

    Objective-C

        id<ZDKObjCIdentity> userIdentity = [[ZDKObjCAnonymous alloc] initWithName:nil email:nil];
        [[ZDKZendesk instance] setIdentity:userIdentity];
    

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

The Support SDK is now initialized and ready for use.

Launching the Support SDK UI

The Support SDK provides 4 view controllers:

  • HelpCenterOverviewViewController
  • HelpCenterArticleViewController
  • RequestViewController
  • RequestListViewController

These UIViewControllers are returned by RequestUi and ZDKHelpCenterUi. They can be presented in any way but must be contained in a UINavigationController. Example:

Swift

let viewController = RequestUi.buildRequestUi(with: [])
self.navigationController?.pushViewController(viewController, animated: true)

Objective-C

UIViewController *requestList = [ZDKRequestUi buildRequestUiWith:@[]];
[self.navigationController pushViewController:requestList animated:YES];

They can be configured using RequestUiConfiguration and ZDKHelpCenterUI. Example:

Swift

//Create a configuration object
let config = RequestUiConfiguration()
config.subject = "Testing the SDK"
config.tags = ["ios", "testing"]
//Present the SDK
let requestScreen = RequestUi.buildRequestUi(with: [config])
self.navigationController?.pushViewController(requestScreen, animated: true)

Objective-C

//Create a configuration object
ZDKRequestUiConfiguration * config = [[ZDKRequestUiConfiguration alloc] init];
config.tags = @[@"Create Request"];
config.subject = @"Test from create request";
//Present the SDK
UIViewController *requestScreen = [ZDKRequestUi buildRequestUiWith:@[config]];
[self.navigationController pushViewController:requestScreen animated:YES];

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

To see some samples of different ways to use the Zendesk mobile SDKs, have a look at our sample apps repo on Github.