Support SDK for iOS in a nutshell
This page gives you the basic steps for getting up and running with the Support SDK.
What is the Support SDK?
The Support SDK helps you add the following features to your app:
- Show all or some Help Center content
- Search Help Center content
- Show open requests
- Create requests
- Update requests
You can customize the colors and fonts of the user interface with the Support SDK for all of these features. See more information on customizing the look
Our own Remember The Date app is a good example of our UI being used.
You can also use the functionality of the Support SDK without the provided UI. This allows you to build your own UI. This takes a little more development time but gives you more control. Find out about API providers on top of which you can build your own UI.
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
Add the SDK to your project.
For details, see Adding the Support SDK.
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.
Zendesk.initialize(appId: "appId", clientId: "clientId", zendeskUrl: "url") SupportUI.initialize(withZendesk: Zendesk.instance)
[ZDKZendesk initializeWithAppId:"appId" clientId:"clientId" zendeskUrl:"url"]; [ZDKSupportUI initializeWithZendesk:[ZDKZendesk instance]];
If you're only using the API providers and building the UI yourself:
Zendesk.initialize(appId: "appId", clientId: "clientId", zendeskUrl: "url") Support.initialize(withZendesk: Zendesk.instance)
[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
zendeskUrlin the code above.
Create an identity so the app can authenticate as a Zendesk Support user, then set it on the
let ident = Identity.createAnonymous() Zendesk.instance?.setIdentity(ident)
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:
These UIViewControllers are returned by
ZDKHelpCenterUi. They can be presented in any way but must be contained in a UINavigationController. Example:
let viewController = RequestUi.buildRequestUi(with: ) self.navigationController?.pushViewController(viewController, animated: true)
UIViewController *requestList = [ZDKRequestUi buildRequestUiWith:@]; [self.navigationController pushViewController:requestList animated:YES];
They can be configured using
//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)
//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.