Help Center byZendesk Guideprovides your customers with a web-based, self-service knowledge base. You can use the Support SDK to show localized content in your Help Center, filter its contents to be more helpful, and use it as a jumping off point for creating a ticket.

The SDK provides the following two controllers to add Help Center to your iOS app:

  • HelpCenterOverviewController
  • ViewArticleController

If you need to build your own UIs, the SDK also has an API provider that gives you access to your organization's Help Center. SeeHelp Center providerin the API providers reference.

Topics covered in this section:

Prerequisites

  • A Zendesk admin has activated Help Center in Zendesk Support. SeeActivating Help Centerin the Support Help Center

  • One or more articles have been published in the knowledge base

  • a Zendesk admin has enabledEnable Guidefor your iOS app in Zendesk Support. SeeConfiguring the SDK in Zendesk Supportin the Support Help Center

UI overview

The default UI of theHelpCenterOverviewControllerlooks as follows:

help center view

To change the look and feel of the UI, seeCustomize the look. The UI doesn't inherit any styling from the web-based version of your Help Center.

The UI is localized in 33 languages and selects the appropriate language based on the device locale. The locale must exist in your Help Center and in your Support account localization settings. The articles in your Help Center must be localized to view them in another language.

Tapping an article in the list shows the article content:

article view

If the user can't find an answer in Help Center, they have the option of tapping the pencil icon in the upper-right corner to open a ticket form:

ticket view

To configure the controller's ticket form, seeConfigure the ticket form of other SDK controllers.

You can disable the ticket form if you don't want it, or if you preferadding a separate ticket form.

Show Help Center

Use thebuildHelpCenterOverviewUiWithConfigsmethod of theHelpCenterUi. Example:

Swift

             
let helpCenter = HelpCenterUi.buildHelpCenterOverviewUi(withConfigs: [])self.navigationController?.pushViewController(helpCenter, animated: true)

Objective-C

             
UIViewController*helpCenter=[ZDKHelpCenterUi buildHelpCenterOverviewUiWithConfigs:@[]];[self.navigationController pushViewController:helpCenter animated:YES];

Note: Above a certain number of articles, the SDK starts to limit how many are fetched and displayed out of performance reasons. If this occurs, the recommended approach is to use the various filters on categories, sections, or labels that we provide to limit and control the amount of results. SeeKnown issues.

Filter articles by category

Set thegroupIdsandgroupTypeproperties of theHelpCenterUiConfiguration. Example:

Swift

             
let hcConfig = HelpCenterUiConfiguration()hcConfig.groupType = .categoryhcConfig.groupIds = [1234, 5678]let helpCenter = HelpCenterUi.buildHelpCenterOverviewUi(withConfigs: [hcConfig])self.navigationController?.pushViewController(helpCenter, animated: true)

Objective-C

             
ZDKHelpCenterUiConfiguration*hcConfig=[ZDKHelpCenterUiConfiguration new];[hcConfig setGroupType:ZDKHelpCenterOverviewGroupTypeCategory];[hcConfig setGroupIds:@[@1234,@5678]];UIViewController*helpCenter=[ZDKHelpCenterUi buildHelpCenterOverviewUiWithConfigs:@[hcConfig]];[self.navigationController pushViewController:helpCenter animated:YES];

Filter articles by section

Set thegroupIdsandgroupTypeproperties of theHelpCenterUiConfiguration. Example:

Swift

             
let hcConfig = HelpCenterUiConfiguration()hcConfig.groupType = .sectionhcConfig.groupIds = [1234, 5678]let helpCenter = HelpCenterUi.buildHelpCenterOverviewUi(withConfigs: [hcConfig])self.navigationController?.pushViewController(helpCenter, animated: true)

Objective-C

             
ZDKHelpCenterUiConfiguration*hcConfig=[ZDKHelpCenterUiConfiguration new];[hcConfig setGroupType:ZDKHelpCenterOverviewGroupTypeSection];[hcConfig setGroupIds:@[@1234,@5678]];UIViewController*helpCenter=[ZDKHelpCenterUi buildHelpCenterOverviewUiWithConfigs:@[hcConfig]];[self.navigationController pushViewController:helpCenter animated:YES];

Filter articles by label

Set thelabelsproperty of theHelpCenterUiConfiguration. Example:

Swift

             
let hcConfig = HelpCenterUiConfiguration()hcConfig.labels = ["ios", "xcode"]let helpCenter = HelpCenterUi.buildHelpCenterOverviewUi(withConfigs: [hcConfig])self.navigationController?.pushViewController(helpCenter, animated: true)

Objective-C

             
ZDKHelpCenterUiConfiguration*hcConfig=[ZDKHelpCenterUiConfiguration new];[hcConfig setLabels:@[@"ios",@"xcode"]];UIViewController*helpCenter=[ZDKHelpCenterUi buildHelpCenterOverviewUiWithConfigs:@[configs]];[self.navigationController pushViewController:helpCenter animated:YES];

Note: The labels are applied to the query by AND rather than OR. Returned content must match all specified labels.

Show a single article

打开一个特定的救援队cle, get the article's id, then usebuildHelpCenterArticle.

Swift

             
let articleController = HelpCenterUi.buildHelpCenterArticleUi(withArticleId: 123, andConfigs: [])self.navigationController?.pushViewController(articleController, animated: true)

Objective-C

             
UIViewController*articleController=[ZDKHelpCenterUi buildHelpCenterArticleUiWithArticleId:123andConfigs:@[]];[self.navigationController pushViewController:articleController animated:YES];

Configure the ticket screen

You can configure the ticketing screen of theHelpCenterOverviewControllerso that each new ticket has a common subject, common tags, or common file attachments. You can also set common values for one or more custom ticket fields, or set the custom ticket form to use in the agent interface in Zendesk Support.

First, configure the ticket screen withRequestUiConfiguration. Seeconfiginadding tickets.

Second, pass theConfigurationobject to theandConfigsparameter of theZDKRequestUifunctions.

Example:

Swift

             
let requestConfig = RequestUiConfiguration()requestConfig.subject = "iOS Ticket"let helpCenter = HelpCenterUi.buildHelpCenterOverviewUi(withConfigs: [requestConfig])self.navigationController?.pushViewController(helpCenter, animated: true)

Objective-C

             
ZDKRequestUiConfiguration*requestConfig=[ZDKRequestUiConfiguration new];requestConfig.subject=@"iOS Ticket";UIViewController*helpCenter=[ZDKHelpCenterUi buildHelpCenterOverviewUiWithConfigs:@[requestConfig]];[self.navigationController pushViewController:helpCenter animated:YES];

Disable Contact Us button and ticket creation

The Help Center has a Contact Us button on the navigation bar that you can use to create a ticket.

The button is visible by default in both the Help Center article list view and article view. You can hide the button in one or both places. This is done using theHelpCenterUiConfigurationand theArticleUiConfiguration.

Disable ticket creation in Help Center

On the Help Center screen, the ticket creation button appears in two places:

  • The navbar on the main screen
  • The search result screen when there are no search results

HelpCenterUiConfigurationhas a boolean property for configuring the visibility of the ticket creation button in the two locations. It is false by default. You can customize the value as required.

Example:

Swift

             
func presentHelpCenter() {let helpCenterUiConfig = HelpCenterUiConfiguration()helpCenterUiConfig.showContactOptions = falselet articleUiConfig = ArticleUiConfiguration()articleUiConfig.showContactOptions = false // hide in article screenlet helpCenterViewController = HelpCenterUi.buildHelpCenterOverviewUi(withConfigs: [helpCenterUiConfig, articleUiConfig])self.navigationController?.pushViewController(helpCenterViewController, animated: true)}

Objective-C

             
-(void)presentHelpCenter{ZDKHelpCenterUiConfiguration*helpCenterUiConfig=[ZDKHelpCenterUiConfiguration new];[helpCenterUiConfig setShowContactOptions:NO];ZDKArticleUiConfiguration*articleUiConfig=[ZDKArticleUiConfiguration new];[articleUiConfig setShowContactOptions:NO];UIViewController*controller=[ZDKHelpCenterUi buildHelpCenterOverviewUiWithConfigs:@[helpCenterUiConfig,articleUiConfig]];[self.navigationController pushViewController:controller animated:YES];}

Disable ticket creation in the article view

ArticleUiConfigurationhas a boolean property for configuring the visibility of the ticket creation button on the article screen. It is false by default. You can customize the value as required.

Example:

Swift

             
func presentArticle() {let articleUiConfig = ArticleUiConfiguration()articleUiConfig.showContactOptions = falselet articleViewController = HelpCenterUi.buildHelpCenterArticleUi(withArticleId: 123, andConfigs: [articleUiConfig])self.navigationController?.pushViewController(articleViewController, animated: true)}

Objective-C

             
-(void)presentArticle{ZDKArticleUiConfiguration*articleConfig=[ZDKArticleUiConfiguration new];[articleConfig setShowContactOptions:NO];UIViewController*controller=[ZDKHelpCenterUi buildHelpCenterArticleUiWithArticleId:123andConfigs:@[articleConfig]];[self.navigationController pushViewController:controller animated:YES];}

Disable ticket creation after an empty search result

SetshowContactOptionsproperty of theHelpCenterUiConfiguration. Example:

Swift

             
func presentHelpCenter() {let hcConfig = HelpCenterUiConfiguration()hcConfig.showContactOptions = falselet helpCenter = HelpCenterUi.buildHelpCenterOverviewUi(withConfigs: [hcConfig])self.navigationController?.pushViewController(helpCenter, animated: true)}

Objective-C

             
-(void)presentHelpCenter{ZDKHelpCenterUiConfiguration*hcConfig=[ZDKHelpCenterUiConfiguration new];[hcConfig setShowContactOptions:NO];UIViewController*helpCenter=[ZDKHelpCenterUi buildHelpCenterOverviewUiWithConfigs:@[hcConfig]];[self.navigationController pushViewController:helpCenter animated:YES];}

Hide the contact button in the My Tickets page

You can hide the Contact Us button on your My Tickets page but settingallowRequestCreationto false.

For example:

             
letrequestListConfig=RequestListUIConfiguration()requestListConfig.allowRequestCreation=falseletrequestList=RequestUi.buildRequestList(with:[requestListConfig])navigationController.pushViewController(requestList,animated:true)

Disable article voting

The Help Center article voting feature in the Support SDK can be enabled and disabled by a Zendesk admin in Zendesk Support. It is enabled by default. SeeConfiguring the SDK in Zendesk Supportin the Support Help Center.

This article voting is entirely separate to resolutions and rejections in回答机器人.

Using Support SDK with Answer Bot SDK

Note:Zendesk has renamed our bot capabilities. Answer Bot is now Zendesk bots. For more information on this change, seethis announcement.

回答机器人by Zendesk, provides a powerful mechanism for deflecting tickets before they reach your agents.

If you have Answer Bot 2.0.0 and Support 5.0.0 (or above) present in your app, you can configure the contact button inHelpCenterOverviewControllerandViewArticleControllerto open the回答机器人Engine. If you do not provide any engine, the user will be directed to ticket creation by default.

Swift

             
func presentHelpCenter() {do {let answerBotEngine = try AnswerBotEngine.engine()let helpCenterUiConfig = HelpCenterUiConfiguration()helpCenterUiConfig.engines = [answerBotEngine]let articleUiConfig = ArticleUiConfiguration()articleUiConfig.engines = [answerBotEngine]let helpCenterViewController = HelpCenterUi.buildHelpCenterOverviewUi(withConfigs: [helpCenterUiConfig, articleUiConfig])self.navigationController?.pushViewController(helpCenterViewController, animated: true)} catch {// do something with error}}

Objective-C

             
-(void)presentHelpCenter{NSError*error=nil;ZDKAnswerBotEngine*abEngine=[ZDKAnswerBotEngine engineAndReturnError:nil];NSArray*engines=@[(id<ZDKEngine>)abEngine];ZDKHelpCenterUiConfiguration*helpCenterUiConfig=[ZDKHelpCenterUiConfiguration new];helpCenterUiConfig.objcEngines=engines;ZDKArticleUiConfiguration*articleUiConfig=[ZDKArticleUiConfiguration new];articleUiConfig.objcEngines=engines;UIViewController*controller=[ZDKHelpCenterUi buildHelpCenterOverviewUiWithConfigs:@[helpCenterUiConfig,articleUiConfig]];[self.navigationController pushViewController:controller animated:YES];}

Overriding device locale

If you want to manually specify what language to use when fetching Help Center content you can do so with:

Swift

             
Support.instance().helpCenterLocaleOverride = ""

Objective-C

             
[ZDKSupport instance].helpCenterLocaleOverride=@"";

If you're only using theAPI providersand building the UI yourself:

Swift

             
Support.instance().helpCenterLocaleOverride = ""

Objective-C

             
[ZDKSupport instance].helpCenterLocaleOverride=@"";

This applies to all Help Center content fetched with the UI and providers, meaning that only the articles, sections, and categories from this locale are fetched. This does not update the mobile UI elements. The language tag must be all lowercase in order to work. The override ignores the device locale and the languages configured in the Zendesk Guide admin console. Overriding with an unsupportedLocaleor no content for that locale results in a "Unable to connect" banner.