SDK Integration

This document provides steps for integrating your Unity application with Hackle via the Hackle SDK. SDK Integration is a must in order to use the functions of a Hackle SDK.

Step #1: Install SDK via the Unity Package Manager

Click here to download the SDK.

In Unity, click Assets > Import Package > Custom Package
Select the downloaded package and import it to complete the installation.

10371037

Android ProGuard / R8

If you are using ProGuard, R8, the obfuscation rules are automatically included in the aar artifact. If this is not the case, you should also include the rule below.

-keep class io.hackle.android.** { *; }
-keep class io.hackle.sdk.** { *; }

📘

Rebuild your app after Step 1

Unity SDK includes Android and iOS SDKs.
The app that is being tested has to be newly built in order to make sure that Step 1 is complete.

Step #2: Initialize the SDK

During this step, we get the information needed for SDK integration from the Hackle Server and store it in the SDK. As this operation runs asynchronously, the callback action lets you know that the initialization is complete.

Initialize by passing the SDK key to the Hackle.Initialize() method, and use the await operation to wait for the initialization to complete.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HackleInit : MonoBehaviour
{
    async void Awake () {
        await Hackle.Initialize("YOUR_APP_SDK_KEY");
    }
}

Did this page help you?