You're 4 steps away from adding great in-app support to your Unity game.
Guide to integrating the Unity plugin for the Helpshift SDK which you can call from your C# and Javascript game scripts.
If you have a project with Unity version prior to 5.3, you could use the build mentioned here.
Helpshift SDK Unity package comes in two variants
This package comes with a secondary dex file consisting of only Helpshift SDK code. Secondary dex install is triggered when the Helpshift SDK is initialized. The SDK apis remain unaffected with secondary dex approach. View Helpshift SDK-only dex impact analysis.
This package comes with a secondary dex file consisting of Helpshift SDK code as well as android support libraries v26.0.2. Secondary dex install is triggered when the Helpshift SDK is initialized. The SDK apis remain unaffected with this secondary dex approach. View unified dex impact analysis.
The Helpshift SDK .unitypackage contains the following files
Import the helpshift-plugin-unity-version.unitypackage file into your Unity game.
The Helpshift Unity package also comes with the appcompat, recyclerview, design and cardview libraries which are the dependencies of the Helpshift Android SDK. If you already have any of the above mentioned dependencies in your app, please uncheck the appropriate folders while importing the package.
If you are upgrading the unity SDK to the newer one and if you want to save the old config, you will have to deselect the HelpshiftConfig.assets
file during importing of the assets package.
Helpshift SDK depends on android support libraries and needs a gradle dependency for successfully building the library.
Unity does not allow different Gradle build scripts for each plugin, therefore, the Helpshift SDK cannot add these dependencies by default. Please follow the steps mentioned in the link below based on the build system you have chosen in Unity in order to successfully build your project:
If you are using gradle build system then ${applicationId} is automatically replaced during build time.
Otherwise, open AndroidManifest.xml
located at <project_dir>/Assets/Plugins/Android/helpshift/
and look for ${applicationId}
located in <provider>
tag. Replace it with the package name of your android app.
As an example, if your package name is PACKAGE_NAME
, <provider>
tag will now look like this:
<provider android:name="com.helpshift.support.providers.HSPluginFileProvider" android:authorities="PACKAGE_NAME.helpshift.fileprovider" android:exported="false" android:grantUriPermissions="true" > <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/hs__provider_paths" /> </provider>
To use Helpshift's APIs, please import the Helpshift's namespace like below
using Helpshift;
Helpshift SDK uniquely identifies your App with the combination of:
To get the API Key
, Domain Name
and the App ID
, navigate to Settings
>SDK (for Developers)
in your agent dashboard and scroll down to "Initializing Helpshift" section. show me
Select your App from the dropdown and copy the three tokens to be passed when initializing Helpshift.
Initialize Helpshift by calling the method install(apiKey, domain, appId) API
using Helpshift; . . . private HelpshiftSdk help; help = HelpshiftSdk.getInstance(); help.install("<API_KEY>", "<DOMAIN_NAME>", "<APP_ID>");
Helpshift is now integrated in your app. You should now use the support APIs to present FAQ or conversation screens inside your app.
Run your app, and try starting a test conversation using the showConversation API call. Then goto your Helpshift agent dashboard and reply to experience the in-app messaging.
Sample usage for FAQs and conversation APIs:
public class MyGameControl : MonoBehaviour { private HelpshiftSdk help; void Start () { this.help = HelpshiftSdk.getInstance(); this.help.install("<API_KEY>", "<DOMAIN_NAME>", "<APP_ID>"); } void onGUI () { ... Dictionary<string, object> configMap = new Dictionary<string, object>(); // Presenting FAQs to your customers if (MenuButton (helpButton)) { help.showFAQs(configMap); } // Starting a conversation with your customers if (MenuButton (contactButton)) { help.showConversation(configMap); } } }
Since the Helpshift plugin is meant for mobile devices only, you should put all Helpshift calls inside checks to make sure they are only called when running on a device. / #run-on-device /
Everytime you update the config via the GUI inspector, please make sure to click on Save Config before starting the next build.
We have now added a Helpshift Configurator for Unity which can help app developers configure the various flags which are generally passed via the config option in all Helpshift APIs. Once you import the helpshift unitypackage, you will see a Helpshift menu in the Unity Editor
From the Helpshift menu, you can launch the Configurator by click on Edit Config. This will open up a GUI inspector which will contain all the available flag options.
You can supply the ApiKey, DomainName and AppId through the Configurator. ApiKeys and DomainName remain the same for Android and iOS apps. AppIds are different for different platforms If you want to use the values supplied through the configurator, please use the HelpshiftSdk.install() call and do not pass in any arguments. In this case the install time configuration will also be picked up from the Configurator.
There are some configurations which are meant to be passed via the install call which configure the instance of Helpshift running in the application.
drawable
folder in the resources of your app i.e Assets/Plugins/Android/helpshift/res/drawable
.raw
folder in the resources of your app i.e Assets/Plugins/Android/helpshift/res/raw
.The Helpshift SDK accepts multiple flags which govern the behaviour of the individual Helpshift screens. If you want to use the SDK configurations via the Configurator, please use the HelpshiftSdk APIs without any arguments, or use the *WithMeta variety if you want to pass in some custom meta-data.
For example :
using Helpshift; . . . . private HelpshiftSdk help; void foo () { help = HelpshiftSdk.getInstance(); // Show FAQs with config from GUI and no meta-data help.showFAQs(); // Show FAQs with config from GUI and meta-data Dictionary <string, object> meta = new Dictionary <string, object>(); ... ... help.showFAQsWithMeta(meta); }