Install & configure Unity SDK
Adapty SDK includes two key modules for seamless integration into your Unity app:
- Core Adapty: This essential SDK is required for Adapty to function properly in your app.
- AdaptyUI: This optional module is needed if you use the Adapty Paywall Builder, a user-friendly, no-code tool for easily creating cross-platform paywalls.
Want to see a real-world example of how Adapty SDK is integrated into a mobile app? Check out our sample app, which demonstrates the full setup, including displaying paywalls, making purchases, and other basic functionality.
Requirements
Adapty SDK supports iOS 13.0+, but requires iOS 15.0+ to work with paywalls created in the paywall builder.
Adapty supports Google Play Billing Library up to 7.x. Support for Billing Library 8.0.0 (released 30 June, 2025) is planned.
Install Adapty SDK
- Download the
adapty-unity-plugin-*.unitypackage
from GitHub and import it into your project.

-
Download and import the External Dependency Manager plugin.
-
The SDK uses the "External Dependency Manager" plugin to handle iOS Cocoapods dependencies and Android gradle dependencies. After the installation, you may need to invoke the dependency manager:
Assets -> External Dependency Manager -> Android Resolver -> Force Resolve
and
Assets -> External Dependency Manager -> iOS Resolver -> Install Cocoapods
-
When building your Unity project for iOS, you would get
Unity-iPhone.xcworkspace
file, which you have to open instead ofUnity-iPhone.xcodeproj
, otherwise, Cocoapods dependencies won't be used.
Activate Adapty module of Adapty SDK
using UnityEngine;
using AdaptySDK;
public class AdaptyListener : MonoBehaviour, AdaptyEventListener {
void Start() {
DontDestroyOnLoad(this.gameObject);
Adapty.SetEventListener(this);
var builder = new AdaptyConfiguration.Builder("YOUR_PUBLIC_SDK_KEY");
Adapty.Activate(builder.Build(), (error) => {
if (error != null) {
// handle the error
return;
}
});
}
}
To get your Public SDK Key:
- Go to Adapty Dashboard and navigate to App settings → General.
- From the Api keys section, copy the Public SDK Key (NOT the Secret Key).
- Replace
"YOUR_PUBLIC_SDK_KEY"
in the code.
- Make sure you use the Public SDK key for Adapty initialization, the Secret key should be used for server-side API only.
- SDK keys are unique for every app, so if you have multiple apps make sure you choose the right one.
Set up event listening
Create a script to listen to Adapty events. Name it AdaptyListener
in your scene. We suggest using the DontDestroyOnLoad
method for this object to ensure it persists throughout the application's lifespan.

Adapty uses AdaptySDK
namespace. At the top of your script files that use the Adapty SDK, you may add:
using AdaptySDK;
Subscribe to Adapty events:
using UnityEngine;
using AdaptySDK;
public class AdaptyListener : MonoBehaviour, AdaptyEventListener {
public void OnLoadLatestProfile(Adapty.Profile profile) {
// handle updated profile data
}
}
We recommend adjusting the Script Execution Order to place the AdaptyListener before Default Time. This ensures that Adapty initializes as early as possible.

Add Kotlin Plugin to your project
This step is required. If you skip it, your mobile app can crash when the paywall is displayed.
-
In Player Settings, ensure that the Custom Launcher Gradle Template and Custom Base Gradle Template options are selected.
-
Add the following line to
/Assets/Plugins/Android/launcherTemplate.gradle
:apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: 'setupSymbols.gradle'
apply from: '../shared/keepUnitySymbols.gradle' -
Add the following line to
/Assets/Plugins/Android/baseProjectTemplate.gradle
:plugins {
// If you are changing the Android Gradle Plugin version, make sure it is compatible with the Gradle version preinstalled with Unity
// See which Gradle version is preinstalled with Unity here https://docs.unity3d.com/Manual/android-gradle-overview.html
// See official Gradle and Android Gradle Plugin compatibility table here https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
// To specify a custom Gradle version in Unity, go do "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)" and specify a path to a custom Gradle version
id 'com.android.application' version '8.3.0' apply false
id 'com.android.library' version '8.3.0' apply false
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
**BUILD_SCRIPT_DEPS**
}
Please keep in mind that for paywalls and products to be displayed in your mobile application, and for analytics to work, you need to display the paywalls and, if you're using paywalls not created with the Paywall Builder, handle the purchase process within your app.
Activate AdaptyUI module of Adapty SDK
If you plan to use Paywall Builder and have installed AdaptyUI module, you need AdaptyUI to be active. You can activate it during the configuration:
var builder = new AdaptyConfiguration.Builder("YOUR_PUBLIC_SDK_KEY")
.SetActivateUI(true);