1. Adding Hotline SDK to your Unity App:

1.1 Download the Hotline Unity package from here 

1.1.1 Download sample Hotline integration script from here

1.2 Import Unity package 

Open Projects Tab, right click on asset folder then select Import Package -> Custom Package

Select the Hotline.unitypackage and import it into your project.

Note: For an iOS only app, do not import the assets under “Android” folder from the package.Similarly for an Android only app, do not import assets under "iOS" folder.

2. Initialize and configure Hotline 

You need to initialize the Hotline SDK to connect Hotline to your app. You can also send user information including Name, Email, Phone Number and custom properties to help segment users. 

2.1 Add HotlineSDK namespace into your app as follows

using HotlineSDK;

2.2 Initialize the SDK

private static HotlineSDK _hotline;

public static Hotline getHotline() {
  if (_hotline == null) {
   _hotline = HotlineiOSSDK.getInstance();
  return _hotline;
 //Add your app id and app key
HotlineConfig config = new HotlineConfig("App_Id", "App_Key");

// Enable notification banner to show updates when the app is open only for iOS

// Enable picture message for messages

// Enable attaching pictures straight from camera

// Initialize SDK with the above configuration

Note: you can get the App_Id and App_Key from the dashboard

2.3 Send User Info

You can send basic user information at any point to give you more context on the user when your support agents are messaging with users

HotlineUser hlUser = new HotlineUser();
hlUser.setPhoneNumber("+91", "1234556789");

2.4 Send Custom Properties

Add and send custom user properties(key value pairs), into dictionary and pass it to the SDK as mentioned below :

Dictionary<string, string> properties = new Dictionary<string, string> {
    { "property1", "value1" },
    { "property2", "value2" }
getHotline ().UpdateUserProperties (properties);

2.5 Clear user data

Clear user data at logout by invoking the clearUserData API. This will clear all user data including conversations from the app and users’ can no longer access old conversations after this. 

getHotline ().ClearUserData ()

3. Launching the Support Experience

Use the code below to launch into the FAQ or Conversation based support experience from a call to action in your app. Your call to action or entry point could be a menu item in your game or an option in main screen of the game.

3.1 FAQs

Use the showFAQs() API to launch the FAQs screen. By default the FAQ Categories is displayed as a grid with a “Contact Us” button at the bottom. For customising this, check the FAQ Options.

Eg. To launch default FAQ experience:

getHotline ().ShowFAQs ()

Customize the FAQ experience

Customizations to the FAQ Flow can be achieved by specifying the relevant options in the FaqOptions instance passed to the showFAQs() API as listed below.


FaqOptions faqOptions = new FaqOptions();

// Pass false to change it to display FAQs as list, default is Grid

// Pass false to hide “Contact Us” option in FAQ screens

// Pass true to display “Contact Us” in top bar (ActionBar/AppBar)

// Specify the tags with which the faqs should be filtered 
// and optionally the title for the filtered faq view.
string[] faqTags = {
faqOptions.filterByTags(faqTags, "Filtered_Screen_Title");


3.2 Conversations

Use the showConversations() API to launch the Conversation Flow.If the app has multiple channels configured, the user will see the channel list.If the app has only one channel configured, the user will be directy taken to the conversation.

getHotline ().ShowConversations ()

4. Enable Push Notifications

4.1 iOS

Register your app for notification

Include the following header for receiving notification in iOS

using NotificationServices = UnityEngine.iOS.NotificationServices;
using NotificationType = UnityEngine.iOS.NotificationType;

To register your iOS app to receive remote notifications, implement RegisterAppForiOSNotification()

void RegisterAppForiOSNotification () {
    tokenSent = false;
    NotificationServices.RegisterForNotifications (
    NotificationType.Alert |
    NotificationType.Badge |

Call RegisterDeviceToken() into your script’s update() method to ensure the deviceToken is passed to Hotline, which is required for push notifications of your script file.

    void RegisterDeviceToken() {
        byte[] token = NotificationServices.deviceToken;
        if (token != null) {
            string hexToken = System.BitConverter.ToString(token).Replace("-", "");
            UpdateDeviceToken (hexToken);
            tokenSent = true;

    void UpdateDeviceToken (string device_Token) {
        getHotline ().UpdateDeviceToken (device_Token);

Pass Remote Notification to Hotline

When a notification is received, invoke HandleNotification() method of Hotline SDK to allow the SDK to process and display the push notification.

private static void handleNotification(Dictionary < string, object > notifData) {
 // if notifData is not in dictionary format, please convert to one 
 // Pass notification data to Hotline if it’s a Hotline Notification
 if (HotlineiOSSDK.getInstance().IsHotlineNotification(result) getHotline().IsHotlineNotification(result)) {
 } else {
  // Process your app’s notification here

Refer Unity’s documentation for device token and registering app for notifications here. https://docs.unity3d.com/ScriptReference/iOS.NotificationServices.RegisterForNotifications.html

4.2 Android

Register for push notification using your own GCM implementation or via other push plugins :

Step 1: Pass device token to Hotline : Call UpdateDeviceToken() to pass the device token received from GCM for the specific user’s device


Step 2: Pass the notification to Hotline : From your app’s push implementation or push plugins handle notification or receive notification methods, pass notifications to Hotline by invoking HandleNotification() of Hotline as shown below

private static void handleNotification(Dictionary < string, string > result) {
 // if response result is not in dictionary format, please convert into one
 if (getHotline().IsHotlineNotification(result)) {

Customize notifications

NotificationConfig notifConfig = new NotificationConfig();

//Set false to disable notification audio

//Set false to disable deeplink on notification click

//Update notification configuration values

5. Unread Count 

For users who don’t have push enabled, a badge count can be displayed somewhere in your app to grab user’s attention to unread messages. Invoke the GetUnreadCountAsync() API from your script’s update() or start() method 

public void ProcessCount(int count) {
    //count is unread message count for your app
    Debug.Log("Your unread message count : " + count);