Zendesk setup

  1. Sign in as an admin to your Zendesk account at {subdomain}.zendesk.com/agent. If you're not a Zendesk admin, ask one to perform these steps for you.

  2. In Admin Center, click the Channels icon () in the sidebar, then select Classic > Mobile SDK.

  3. If you already have a profile set up for your application in the Support admin interface, skip to step 7. Otherwise, click Add app.

  4. Give your app an easily identifiable name and make a note of your Zendesk URL, App ID, and Client ID.

  5. Scroll down the page and select your Authentication method.

  6. Select the Support SDK tab and select any settings that are applicable to your intended in-app experience.

  7. Finally, click the Save button at the bottom of the page.

Zendesk SDK for Unity setup

  1. Download the latest Zendesk SDK release from Zendesk Artifactory.

  2. In the Unity Editor, open the ZendeskSDK.unitypackage file. Ensure all items for import are selected by clicking the All option then click the Import option.

    The Zendesk SDK is extracted in the new Zendesk folder.

  3. Select the Zendesk prefab in the Zendesk folder and drag it into your Scene hierarchy. Alternatively, you can instantiate the prefab in your code. See Integrating the Zendesk SDK for Unity in your code for more details. The Zendesk prefab should be placed into the root of your Project Hierarchy and should not be renamed.

  4. If one is not already present in your scene, add an Event System component by right-clicking in your hierarchy and selecting Event System in the UI menu.

  5. Click the Zendesk prefab within your Hierarchy and ensure the "Basic Setup" tab is selected. Fill the Zendesk URL, App ID, and Client ID with the values retrieved from your Support admin interface in the previous section.

    By default, the SDK locale is set to automatically, based off the device locale. You can disable this functionality in the Inspector and force a specific locale if needed.

    Note: If you're using multiple brands, you can use a brand subdomain rather than the primary subdomain in the Zendesk URL in the code above. Keep in mind that the end user will only be able to view tickets that belong to that brand. If Enable Guide option is selected in Support Admin Panel for your application, please make sure your brand also has a help center.

  6. While Common Tags are not necessary, you can optionally input any tags on the Advanced tab that you want to send with every call to your Zendesk backend.

    For example, if you have two different live applications, you may want to distinguish them for agents in the Support agent interface with a common tag that represents the name or version of the application. The tag is sent with every customer request submitted.

  7. Click the Test Configuration button to check if your Zendesk SDK has been set up correctly. This test will also give any relevant feedback to the locale being detected on the device, or the locale set via the Inspector menu.

  8. Pause control is enabled by default in the Zendesk SDK. This calls an assigned Pause and Resume method when the Zendesk SDK is opened by a user.

    Pause and Resume methods are controlled by action delegates, which allow you to drag calls to your own Pause and Resume methods onto the Inspector Window as you would with a standard Unity event listener or Button OnClick() method. By default, basic Pause and Resume methods that set your project's TimeScale to 0 and 1 respectively are included and can be safely overwritten by your own methods.

    This automatic functionality can be fully disabled by un-checking the Auto Pause checkbox on the Pause Control tab in the Inspector.

  9. If you intend on building your project for mobile platforms, see the Zendesk/Unity Mobile Platform Settings guide.

At this point, the Zendesk SDK should be ready to use with three buttons (Support, Create a request, and Help Center) visible in the Scene. You should have full access to browse help center articles and engage with Support requests as a user in your Unity project. Hit the Play button on your Scene to test it out.

The buttons displayed after dragging and dropping the Zendesk prefab into your Scene are only intended to serve as example buttons. The buttons themselves may be misleading as they appear in a menu-style layout. However, there's no menu panel or open logic hooked up to them. This would need to be done during integration.

Important: We strongly recommend that you instantiate the Zendesk.prefab only when Zendesk functionality is needed.

See the Sample Buttons section.

Integrating the Zendesk SDK for Unity in your code

You can instantiate the Zendesk SDK for Unity using the code below. You only need to reference the Zendesk.prefab into a public property and use the Instantiate method.

//Zendesk prefab must be referenced in your scriptpublic GameObject zendeskObject;
public void StartZendesk(){	GameObject zendeskObjectInstantiated = Instantiate(zendeskObject);}

Initializing the Zendesk SDK for Unity

The Zendesk SDK for Unity is initialized automatically when you instantiate the Zendesk.prefab.

If you want more information about the state of the initialization, you can check the status using the InitialisationStatus property from the ZendeskMain script.

Note: You can use the Init method in ZendeskMain.cs if the init fails.You can see an example of usage:

if (zendeskGO.GetComponent<ZendeskMain>().InitialisationStatus == InitialisationStatus.Failed){    zendeskGO.GetComponent<ZendeskMain>().Init();}

InitialisationStatus enum

NotInitialisedInitialization process not started (default value)
InProgressInitialization in progress
InitialisedInitialized with success
FailedFailed to initialize