Getting Started iOS

You're 3 steps away from adding great in-app support to your Unity game.

Guide to integrating the Unity plugin for the Helpshift SDK X which you can call from your C# and Javascript game scripts.

Requirements

  • Unity 5.5.6 and above.
  • Xcode 12.0 and above.
  • Supported iOS versions:
    • iOS 14, 12, 11, and 10

Download HelpshiftX Unity SDK for iOS

Download SDK v10.0.1

HelpshiftX SDK .zip folder includes:

helpshiftX-plugin-unity-v10.0.1.unitypackage
Unity package of HelpshiftX SDK
unity-jar-resolver (v1.2.104.0)
Resolves Android Helpshift package support lib dependencies.

Add Helpshift to your Unity project

  • Unzip the HelpshiftX Unity SDK package.
  • HelpshiftX Unity SDK appears as a standard .unitypackage which you can import through the Unity package import procedure.
  • Following are the steps to import the helpshiftX-plugin-unity-version.unitypackage into your Unity game:
    1. In the Open Unity project, navigate to Assets drop-down menu and select the Import Package > Custom Package
    2. From the unzipped SDK, select helpshiftX-plugin-unity-version.unitypackage file to import the Helpshift SDK.
    3. Click Import.

Info.plist changes - Addition of usage description strings

When the “User Attachments” feature is enabled from the webchat config, the SDK allows the user to upload the attachments. The attachments can be picked from the Photo Library or can be captured directly using the camera. The options for these sources look like:

To use the camera and photo library, Apple requires the app to have Usage Description strings in the Info.plist while. Failing to add these strings might result in app rejection. The following strings are needed for the attachment feature:

Key Suggested string Notes
NSPhotoLibraryUsageDescription “We need to access photos library to allow users manually pick images meant to be sent as an attachment for help and support reasons.” This is not needed if your app is iOS 11 or above. Below iOS 11, this key is compulsory else the app may crash when user tries to open the photo library for attaching photos.
NSCameraUsageDescription “We need to access the camera to allow users to click images meant to be sent as an attachment for help and support reasons.” This key is needed for capturing a photo using camera and attaching it.
NSMicrophoneUsageDescription “We need to access the microphone to allow users to record videos using camera meant to be sent as an attachment for help and support reasons.” This key is needed for capturing a video using camera and attaching it.

Note that the above strings are just a suggested description. If you need localisations for the same, please Contact Us

End-users can attach files such as pdf, video, etc in their issues. For iOS 10 and below, to access files in the “Files” app of iOS, developers will need to add iCloud capability with iCloud Documents services enabled. For more info please refer the Prerequisites section here.    show me

Initializing Helpshift in your app

Helpshift's namespace

To use Helpshift's APIs, please import the Helpshift's namespace like below

using Helpshift;
  1. First, create an app on the Helpshift Dashboard show me

  2. Create an app with iOS as a selected Platform show me

Helpshift uniquely identifies each registered App with a combination of 2 tokens:

Domain Name
This is your Helpshift domain name e.g. happyapps.helpshift.com
Platform ID
Your App's unique platform id
You can find these by navigating to Settings>SDK (for Developers) in your agent dashboard. Select your App and check webchat as a platform from the dropdowns and copy the 2 tokens to be passed when initializing Helpshift. show me

Initialize Helpshift by calling the method install(platformId, domain) API

using Helpshift;
.
.
.
public class MyGameControl : MonoBehaviour
{
    private HelpshiftSdk help;
    ...

    void Awake() {
        help = HelpshiftSdk.GetInstance();
        var configMap = new Dictionary<string, object>();
        help.Install(platformId, domainName, configMap);
    }
    ...
}

Install Helpshift via ObjC

If you intend to initialize the SDK from Xcode using Objective C, You can specify Domain Name, Platform ID and other install configurations in the Objective-C code. To do this you need to override application:didFinishLaunchingWithOptions in HsUnityAppcontroller as shown below.

#import <HelpshiftX/HelpshiftX.h>
#import "HelpshiftX-Unity.h"

- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Set install configurations
    NSDictionary *installConfig = @{@"enableInAppNotification":@YES};

    // Make install call
    [Helpshift installWithPlatformId:@"<your_platform_id>" domain:@"<your_domain_name>" config:installConfig];
    return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

Start using Helpshift

Helpshift is now integrated in your app. You should now use the support APIs inside your app to experience the functionality provided by the Helpshift SDK

Next up

Helpshift APIs

Discover ways to do customer support via Helpshift.

Design

Theming and Skinning your SDK to look like your App.

Notifications

Configure Push and In-app notifications.

Tracking

Track events and user actions. Attach custom metadata to every conversation.

Going International

Localizing & Internationalizing your in-app Support.