Zendesk iOS SDK: Customize UI for Answer Bot engine

223 views Asked by At

I have added the Zendesk iOS Answerbot SDK to an app and I would like to:

  1. Customize the initial messages
  2. Direct the user to a different view when the "Leave a message" button is tapped

This is the code I have so far:

do {
      let messagingConfiguration = MessagingConfiguration()
      let answerBotEngine = try AnswerBotEngine.engine()
      let supportEngine = try SupportEngine.engine()
      let viewController = try Messaging.instance.buildUI(engines: [answerBotEngine, supportEngine], configs: [messagingConfiguration])

      let button = UIBarButtonItem(title: "Close", style: .plain, target: self, action: #selector(dismissView))
      viewController.navigationItem.leftBarButtonItem = button

      let helpController = UINavigationController(rootViewController: viewController)

      self.present(helpController, animated: true, completion: nil)
    } catch {
      print(error)
    }

This is what the default UI looks like:

AnswerBot UI

Zendesk AnswerBot for iOS documentation: https://developer.zendesk.com/documentation/classic-web-widget-sdks/unified-sdk/ios/answer_bot_engine/

It looks like the customization options are limited based on this documentation: https://developer.zendesk.com/documentation/classic-web-widget-sdks/unified-sdk/ios/customizing_the_look/

You can name the bot like below, but not finding examples of much else.

let messagingConfiguration = MessagingConfiguration()
messagingConfiguration.name = "Bot Name"

It seems like you can use the API and build your own UI, but I was wondering if my questions are possible in the default SDK.

1

There are 1 answers

0
sailor-saturn On

Regarding your first question, you can in fact override any string that Zendesk provides by doing the following:

If your project does not yet have a Localizable.strings file with the different language variants, you can create one by following these steps: In Xcode, select File > New > File Select Resource in the iOS category in the sidebar Select Strings File from the files and click Next. Name the file Localizable and click Create.

Reference

For example, you can override the SupportSDK greeting message by just adding this to your localizable file:

"ios.SupportEngine.greeting.message" = "Please remain calm the police is coming ‍♀️";

But if you support more than one language you should override in all localizable files.

Take a look at the massive list of all of the localizable strings you can override.

Regarding your second question, as far as I know, every logic inside the Zendesk chat does not allow extra configuration to show other views. Since you can't override the click of Leave a Message since you can't access that component from your app.

I hope I could help in your case, have a great week.