SDK v3.0.0 removes SWRVE and adds DeltaDNA. See upgrade/installation and testing instructions for additional info.
SDK v3.1.2 Includes an Adjust Upgrade with support for Uninstall and Reinstall Tracking.

Unity Editor Setup

  1. In Unity, select Assets -> Import Package -> Custom Package… Find and select kongregate-sdk-x.x.x/Unity/Kongregate.unitypackage and select all files.
    • You may receive some warnings about images/textures/PNG files during the import. You can ignore these.
    • If you plan to use the Gradle build system, exclude the files under Assets/Android
  2. Create an Empty Game Object named Kongregate. Attach a new script to the game object to handle initializing and managing the Kongregate SDK. You may use the KongregateGameObject-Example.cs file as a starting point for this as it contains a lot of the hooks already in the script that you will need to implement. Feel free to modify this to suit your needs and remove or comment out the unneeded example code. Verify that you have set your Game ID and API Key in this file.
    • The Kongregate SDK also includes Assets/Plugins/Kongregate/KongregateManager.cs and set of demo scripts under Assets/Plugins/Kongregate/demo. The KongregaetGameObject-Example.cs script is the traditional starting point that many devs are familiar with. This example script is still fully supported. The KongregateManager.cs class is intended to be a starting point that may be directly used by your game. Simply attach it to the kongregate game object you created and initialize the fields. The individual demo scripts are broken into logical API’s our SDK provides. Feel free to use either approach.

Unity Android Setup

Below are extra steps required for Android builds.

Shared Secret Provider

Most Kongregate games support Shared Sign-on meaning when you log into one Kongregate Game you automatically log into other Kongregate Games without needing to re-enter a username and password. To support this on Android your game must:

  1. Be signed using Kongregate’s certificate (see Mobile Build System)
  2. Define a Shared Secret Provider and the custom ReadSharedData2 permission as described below.

Use the Shared Secret Provider Generator tool to generate a Shared Secret Provider class and retrieve the entries that must be added to /Assets/Plugins/Android/AndroidManifest.xml. If this file doesn’t exist, you can copy the base one from Unity /Applications/Unity/PlaybackEngines/AndroidPlayer/Apk/AndroidManifest.xml.

Select Tools -> Kongregate Tools -> Shared Secret Provider Generator, Click Generate Provider and follow the instructions in the Text Box:

Provider Generator

Copy the <provider>, <permission>, and <uses-permissions> tags out of the text box and past them into your AndroidManifest.xml. Be sure the resulting android:name and android:authority follow the format[YourGame]SharedSecretProvider. This name must be unique across all Kongregate games.

If you have problems with the tool, you may use the providerbuilder ant script instead.

Gradle Support

If you choose Gradle as the build system, you will want to add the DeltaDNA dependencies in through the Gradle file. You may also pull in the Adjust and Kongregate SDK this way as well. Depending on what other plugins you use, this may be a preferable option as it can simplify bringing in the Google Play Games dependencies described below. It also enables the ability to use ProGuard, which may help address DEX method count limits.

  1. Delete Assets/Plugins/Android/
  2. Delete Assets/Plugins/Android/gson-2.8.2.jar
  3. Click Custom Gradle Template under Android Build Settings
  4. Edit Assets/Plugins/Android/maintTemplate.gradle as follows.

allprojects {
  repositories {
    flatDir {
      dirs 'libs'

    // add following three lines
    jcenter ()
    jcenter ({ url = '' })
    maven { url '' }


dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])

  // add following line to include the DeltaDNA dependencies
  compile ''

  // add the following line to include Google Referrer API
  compile ''

  // add following line to import gson
  compile ''


That should do it! Note, that if you have existing versions of support-v4 or play-services-ads you will get DEX errors. Resolving these usually involves deleting the versions included in your Assets/Plugins/Android sub-directory.

If you wish to enable ProGuard, see kongregate_sdk-x.x.x/Android/proguard.txt for additions required by the Adjust and Kongregate SDKs.

Google Play Game Services Library

The Kongregate and DeltaDNA SDKs require the Firebase Messaging and Ads Identifier components from Google Play Game Services library. Google’s support-v4 and support annotations is also required. You have a few options for adding the required dependencies. NOTE: If you used the Gradle build system described above, you should be all set. However, if your game has further integrations with GPGS, you may need to use one of the options below.

Option 1 (preferred): using Google Play Games Plugin (adding Firebase and Ads to dependencies)

If you use Google Play Games Plugin for Unity for Play Services integration you can take advantage of the PlayServicesSupport class to manage the extra modules required by our SDK. Simply drop this class (KongregateGPSDependencies.cs) in your /Assets/Editor/ directory and the PlayServicesSupport class will download the modules. Newer versions of the plugin make use of Unity Jar Resolver which can use Assets/Kongregate/Editor/Dependencies.xml and Assets/DeltaDNA/Editor/Android/Dependencies.xml to manage dependencies.

Option 2: using other third party GPGS plugins

If you use another GPS Plugin, such as Prime31’s, you may or may not be all set. The plugin must include the Cloud Messaging and Ads modules. If they are missing, you will need to add them modules or the complete GPS library project as described below. You may need to resolve JAR files that are included by multiple Plugins.

Option 3: copy over only the required GPGS and Support AARs

This approach only works in Unity 5, and involves copying over all the requires GPGS and Support Android Archives (AARs) from a maven repository. This will provide you with the minimal required modules and should help prevent hitting the too many method references error, though it’s not quite as convenient as 1 since you must manually manage the dependencies. Be warned that missing dependencies can lead to runtime errors.

  1. Download the following aar files and their dependencies from maven: Support-v4: Support-Annotations: Play Services Ads Identifier: Firebase Messaging:

  2. Add the downloaded aar files under Assets/Plugins/Android

DEPRECATED Option 4: include the full Google Play Game Services and support library projects

If you do not use a Play Services plugin, you need to include the google play services jar and required resource into your project.

  1. Use the Android SDK Manager to download the Extras/Google Play Services and Extras/Android Support Library and Support Library Projects. For more details, see the full setup instructions

  2. Copy the google play services library projects into your your project.

     cp -r <android_sdk>/extras/google_play_services/libproject/google-play-services_lib <unity_project>/Assets/Plugins/Android

    You should be good to go at this point. However, the big drawback with this approach is that it includes all the GPGS modules and you are likely to run against a too many method references error.

Troubleshooting GPGS and Support files

A common issue adding GPGS and Support files to your project is that another Unity Plugin may already include some of the modules leading to duplicate class conflicts at compile time. To resolve this, identify the JARs or AARs that are included twice and delete whichever one is older. This most often happens with the support-v4.jar which is used by many plugins.

Google Referrer API

Adjust requires the Google Referrer API. If you followed the Gradle or instructions above, you should be all set. If you are not using Gradle or Unity Jar Resolver, download the AAR directly from Google’s maven repository and drop it in your /Assets/Plugins/Android directory.

DEX Method Limit

Once you’ve added all the various plugins required, it’s not unusual to hit the 64K DEX Method limit. Unity is improving it’s support for Gradle Builds with every release, which will hopefully eventually remove this restriction. For now, however, the best option is to trim your plugins to only include what you need.

If you still are bumping against the 64K limit, you may be able to apply the following technique to some of your plugins to bring down the number methods they bring in.

  1. Look for plugins that do not contain any resources. That is they do not contain a /Assets/Plugins/<plugin>/res directory or the /res directory is empty. For example the beta and answers plugins included with Fabric do not contain any resources and are good candidates for this technique.
  2. Open the AndroidManifest.xml of the plugin and change the package name in the manifest tag to match the package name of your app.

This should save just over 1600 methods per plugin. A few more tips may be found in our FAQ.

Unity iOS Setup

The unitypackage includes /Assets/Editor/KongregatePostProcessor.dll that will perform all the required modifications to the XCode project at build time. If this post-processor interferes another post-processor your projects uses, you may need to disable it by removing the KongregatePostProcessor.dll file and performing the following steps when you build the XCode project.

  1. Make sure the KongregateSDK and dependencies are added to the Xcode project. Drag the following files Assets/Editor into the generated XCode project.


    The KongregateSDK.framework, KongregateUnityWrapper.framework and AdjustSDK.framework should now be in the Linked Frameworks and Libraries section of your projects General Build Settings. The KongregateSDK.bundle should now be in the Copy Bundle Resources section of your project’s Build Phases

  2. Add any missing dependent iOS frameworks to your project under General -> Linked Framworks and Libraries.

  3. Add the following linker flags under Build Settings -> Linking -> Other Linker Flags


Unity Web Setup

Please see the web integration documentation for information on Unity web player builds.


Initialize the SDK in the script attached to the Kongregate Game Object you created. You may see the kongregate-sdk-x.x.x.x/Unity/KongregateGameObject-Example.cs for a complete sample. This file is intended as an example. It may be used as a starting point, but be sure to review and adapt it for your games needs, removing any unnecessary parts.

Initialize the SDK as soon as possible after you app starts. The Game Objects onEnable() method is a good place.

  // Modify the settings in the static `KongregateAPI.Settings` object prior to initializing our SDK.
  // Your producer will provide you with the correct values .
  // Be sure to use the correct values for Android and iOS builds.
  KongregateAPI.Settings.KongAnalyticsId = "YourKongAnalyticsID";
	KongregateAPI.Settings.KongAnalyticsKey = "YourKongAnalyticsKey";
  KongregateAPI.Settings.DeltaEnvironmentKey = "YourDeltaDNAKey";
  KongregateAPI.Settings.DeltaCollectUrl = "YourDeltaDNACollectURL";
  KongregateAPI.Settings.DeltaEngageUrl = "YourDeltaDNAEngageURL";
  KongregateAPI.Settings.AdjustAppToken = "YourAdjustAppToken"
  KongregateAPI.Settings.AdjustEventTokenMap = new Dictionary<string,object>()  {
    { KongregateAPI.ADJUST_SALE, "YourSaleToken" },
    { KongregateAPI.ADJUST_SESSION, "YourSessionToken" },
    { KongregateAPI.ADJUST_INSTALL, "YourInstallToken" }
  KongregateAPI.Settings.AdjustEnvironment = "sandbox"; // be sure to set to "production" for release builds
  // Android settings here
  // Settings common for iOS and Android
  KongregateAPI.Settings.AdjustEnvironment = "sandbox"; // be sure to set to "production" for release builds

  KongregateAPI kongregate = KongregateAPI.Initialize(GetGameId(), GetAPIKey());

  // Set the callback that will be invoked to collect game specific properties to include in all analytic events.
  kongregate.Analytics.SetCommonPropsCallback(() => {
    Dictionary<string,object> commonProps = new Dictionary<string, object>()
      { "hard_currency_balance", 100 },
      { "soft_currency_balance", 200 },
      // ...
    return commonProps;

IMPORTANT: Adjust require different tokens/keys/ids for Android and iOS. Use #define’s or some other mechanism to help make sure they are set properly for your build. DeltaDNA also has different IDs for Sandbox and Production mode, and Adjust has an environment setting that must be set for Sandbox Production.

Lifecycle Hooks

The Kongregate SDK must be notified when the app is paused or resumes. This is important for accurately tracking sessions and pausing/resuming background tasks.

void OnApplicationPause(bool pausing) {
  KongregateAPI kongregate = KongregateAPI.GetAPI();
  if (pausing) {
  } else {

Event Callbacks

You should set a callback listener for processing Kongregate events.

KongregateAPI.GetAPI().SetEventBundleListener(gameObject, (string eventName, string eventJSON) => {
  // handle the kongregate events

User info & Services

You may access various information about the user.

KongregateAPI api = KongregateAPI.GetAPI();
string username = api.Services.GetUsername();
string authtoken = api.Services.GetGameAuthToken();
bool isguest = api.Services.IsGuest();

Statistics, Scores & Achievements

You may submit statistics through the client, if you game supports Kongregate Achievements. This may also be done server-to-server using our REST API.

KongregateAPI.GetAPI().Stats.Submit("HighScore", 1);

Mobile control & button

You may either let the button draw natively, or manually open the kongregate panel

//configure up our button
kongregate.Mobile.ButtonSetNativeRendering(true); // true by default, false means render in Unity rather than native

// if our button is not hidden, we need to draw it
if (!kongregate.Mobile.ButtonIsHidden()) {
  if (kongregate.Mobile.ButtonIsNativeRendering()) {
    //nothing to do, rendering is handled in native SDK
  } else {
    // draw our button
    if (GUI.Button (kongregate.Mobile.ButtonGetRect(), kongregate.Mobile.ButtonGetTexture(), "label")) {
      Debug.Log ("You clicked the Kong button!");

Unity API Docs & Usage

Unity API Documentation