Skip to main content

Overview

The Encore Unity package lets your game present premium brand offers, real perks a brand funds to acquire customers, at the moments you choose. It is a C# API over the native iOS (EncoreKit) and Android (com.encorekit:encore) SDKs, and over the Encore web SDK in a WebGL build: the SDK draws the reward sheet and trigger components above your game, and runs the analytics. You’ll add External Dependency Manager for Unity, which brings in the native SDKs at build time, then add the package.

Prerequisites

  • Unity 2022.3 or later.
  • Android: minimum API level 24, target API level 35.
  • iOS: deployment target 15.0. Offers show on iOS 17 and later. On iOS 15 and 16, ShowAsync() returns not presented with the reason UnsupportedOS, and trigger components draw nothing.
  • WebGL: read the WebGL warning below first. The package bundles the Encore web SDK, so the WebGL template needs no change.
  • Your API Key (starts with pk_...) from the Encore Dashboard.
Don’t have an API key? Visit dashboard.encorekit.com to create an account, add your app, and receive your API key automatically.
The package supports Android, iOS, and WebGL builds. Where the platforms differ, each reference page names the ones that read a setting. In the Unity Editor every placement returns a not-presented result and trigger components stay empty, so your game still runs there.
WebGL is tested on Unity 6.3 only, in desktop Chrome, iOS Safari, and Android Chrome, and in a cross-origin iframe on iOS Safari. Unity 2022.3 does not support mobile browsers. When a sheet opens while the game is in full-screen mode, the game leaves full-screen mode so the sheet can show. On a phone in landscape, the sheet opens as a column in the middle of the screen.
Some Unity versions and billing packages need a step before an Android build succeeds. Read Build compatibility before your first device build.

Step 1: Add External Dependency Manager for Unity

The package lists the native SDKs in Editor/EncoreDependencies.xml. External Dependency Manager for Unity (EDM4U) reads that file and adds the native SDKs to your Android Gradle build and the CocoaPods file of your iOS build. Without EDM4U, the native SDKs are not in your build. If your project doesn’t have EDM4U yet, add the OpenUPM registry and the package to Packages/manifest.json:
Many ad and analytics SDKs already bring EDM4U. Keep one copy.

Step 2: Add the package

Pick a version from the Encore Unity SDK releases. In Unity, open Window → Package Manager, select + → Add package from git URL, and enter the URL with that version’s tag in place of vX.Y.Z:
Or add it to Packages/manifest.json:
The tag pins the version, so the package changes only when you change the tag. The package is com.encorekit.unity. It pins the native SDKs it was built against to exact versions. Version 2.5.0 pins com.encorekit:encore 2.5.0 on Android and EncoreKit 2.5.0 on iOS, and bundles @encorekit/web-sdk 2.5.0 for a WebGL build.

Step 3: Platform setup

Android: set Minimum API Level to 24 or higher under Project Settings → Player → Android → Other Settings. If your project has no Assets/Plugins/Android folder, create it. EDM4U writes its Gradle templates there and adds com.encorekit:encore to them when you build.
Without that folder, EDM4U falls back to a resolver that fails on Unity 6, and the build log shows Resolution failed for com.encorekit:encore.
iOS: nothing to set beyond the deployment target. EDM4U adds the EncoreKit pod to every target of the Xcode project Unity exports, including the app target, which must embed the framework.

Next steps

Configure the SDK

Initialize Encore with your API key

Build compatibility

Unity versions and billing packages, measured