Zendesk/Unity Mobile Platform Settings

Overview

To take advantage of native system tools to allow for file attachments through a system's respective platform-specific file browser, mobile platform builds must be compiled with the below listed dependencies and permissions calls.

Existing C# dependencies

Any dependencies (inclusive of theming libraries) required for the deprecated Zendesk C# wrapper for Unity should be removed from your project settings.

Note: The UnityTheme style for Android (android:theme="@style/UnityTheme") has been noted to cause build and run-time errors on exported Unity projects. We recommend ensuring this is removed before proceeding.

iOS dependencies

Apple's Privacy Manifest

Starting May 1, 2024, Apple requires the inclusion of a mandatory Privacy Manifest file to enhance user privacy and data transparency.

Compatibility Notes

You must manually create a Privacy Manifest file following the instructions from Apple's documentation.

The contents of the Classic Zendesk SDK for Unity Privacy Manifest is shown here.

Zendesk.xcprivacy
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0">    <dict>        <key>NSPrivacyAccessedAPITypes</key>        <array>            <dict>                <key>NSPrivacyAccessedAPIType</key>                <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>                <key>NSPrivacyAccessedAPITypeReasons</key>                <array>                    <string>0A2A.1</string>                </array>            </dict>            <dict>                <key>NSPrivacyAccessedAPIType</key>                <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>                <key>NSPrivacyAccessedAPITypeReasons</key>                <array>                    <string>C617.1</string>                </array>            </dict>            <dict>                <key>NSPrivacyAccessedAPIType</key>                <string>NSPrivacyAccessedAPICategoryUserDefaults</string>                <key>NSPrivacyAccessedAPITypeReasons</key>                <array>                    <string>CA92.1</string>                </array>            </dict>            <dict>                <key>NSPrivacyAccessedAPIType</key>                <string>NSPrivacyAccessedAPICategorySystemBootTime</string>                <key>NSPrivacyAccessedAPITypeReasons</key>                <array>                    <string>35F9.1</string>                </array>            </dict>            <dict>                <key>NSPrivacyAccessedAPIType</key>                <string>NSPrivacyAccessedAPICategoryDiskSpace</string>                <key>NSPrivacyAccessedAPITypeReasons</key>                <array>                    <string>E174.1</string>                </array>            </dict>        </array>        <key>NSPrivacyCollectedDataTypes</key>        <array>            <dict>                <key>NSPrivacyCollectedDataType</key>                <string>NSPrivacyCollectedDataTypeUserID</string>                <key>NSPrivacyCollectedDataTypeLinked</key>                <true />                <key>NSPrivacyCollectedDataTypeTracking</key>                <false />                <key>NSPrivacyCollectedDataTypePurposes</key>                <array>                    <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>                </array>            </dict>            <dict>                <key>NSPrivacyCollectedDataType</key>                <string>NSPrivacyCollectedDataTypeDeviceID</string>                <key>NSPrivacyCollectedDataTypeLinked</key>                <true />                <key>NSPrivacyCollectedDataTypeTracking</key>                <true />                <key>NSPrivacyCollectedDataTypePurposes</key>                <array>                    <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>                </array>            </dict>            <dict>                <key>NSPrivacyCollectedDataType</key>                <string>NSPrivacyCollectedDataTypeOtherDiagnosticData</string>                <key>NSPrivacyCollectedDataTypeLinked</key>                <true />                <key>NSPrivacyCollectedDataTypeTracking</key>                <false />                <key>NSPrivacyCollectedDataTypePurposes</key>                <array>                    <string>NSPrivacyCollectedDataTypePurposeAnalytics</string>                </array>            </dict>        </array>    </dict></plist>

Limited Photos Library

With the release of iOS 14, the new Photos Picker was introduced with the Limited Photos Library feature, where users can directly control which photos and videos an app can access.

The Zendesk SDK for Unity does not yet support this feature. This means that access to the full library is required for the attachment functionality to work.

Info.plist dependencies

Your app's Info.plist file must include user-facing text for the NSPhotoLibraryUsageDescription key, which the system displays when asking the user for access permission to their Photo Library.

For more information, please see Apple's documentation on Requesting Authorization to Access Photos.

Xcode setup

Under your project hierarchy in Xcode, open your Info.plist and add a new key "Privacy - Photo Library Usage Description". Set its value to "This allows us to access your camera roll so you can upload photos. Enable access from your app settings.".

Postprocess/Code setup

If you are instead using a postprocess script to run on your Unity project at compile-time, the following snippet can be used to append a value to the required NSPhotoLibraryUsageDescription key.

private const string PHOTO_LIBRARY_USAGE_DESCRIPTION = "This allows us to access your camera roll so you can upload photos. Enable access from your app settings.";
PlistElementDict rootDict = plist.root;rootDict.SetString("NSPhotoLibraryUsageDescription", PHOTO_LIBRARY_USAGE_DESCRIPTION);

PBXProject dependencies

The Zendesk SDK requires use of the Photos, AssetsLibrary, MobileCoreServices, and ImageIO frameworks.

Xcode setup

Under your project hierarchy in Xcode, select Build Settings > Linking > Other Linker Flags, and ensure the following Linker Flags are added to your project:

-weak_framework Photos-framework AssetsLibrary-framework MobileCoreServices-framework ImageIO
Postprocess/Code setup

You can use the following script to append all required frameworks to your PBXProject file:

pbxProject.AddBuildProperty(targetGUID, "OTHER_LDFLAGS", "-weak_framework Photos");pbxProject.AddBuildProperty(targetGUID, "OTHER_LDFLAGS", "-framework AssetsLibrary");pbxProject.AddBuildProperty(targetGUID, "OTHER_LDFLAGS", "-framework MobileCoreServices");pbxProject.AddBuildProperty(targetGUID, "OTHER_LDFLAGS", "-framework ImageIO");

Android dependencies

build.gradle dependencies

Update your project's build.gradle file and ensure the following are appended to your dependencies:

implementation fileTree(dir: 'libs', include: ['*.jar'])implementation 'androidx.appcompat:appcompat:1.0.2'

Sample build.gradle excerpt

dependencies {	implementation fileTree(dir: 'libs', include: ['*.jar'])	implementation 'androidx.appcompat:appcompat:1.0.2'**DEPS**}

Manifest dependencies

Update your project's AndroidManifest.xml application subsection with the following key:

<activity android:name="com.zendesk.gallery.Gallery" android:label=""/>