Skip to main content

Overview

Configure the package with your API Key when your game starts. This initializes the Encore SDK on the device: the native SDK on Android and iOS, and the web SDK on WebGL. A reward placement needs no purchase controller, so the API key is all it needs. A ReduceChurn placement whose offers sell a product also needs an IEncorePurchaseController, passed to Configure.

Initialize Encore

Call Encore.Configure once, from the Unity main thread, before you identify the player or present anything. A MonoBehaviour in your first scene is a good place:
Replace pk_your_api_key_here with your publishable Live key from the Dashboard under Settings → Project API Keys. Use the Test key for development builds. Configure throws ArgumentException when the key is null or empty. The full contract is on Configure().

Log level

Pass a LogLevel to see Encore’s logs. The default is LogLevel.None:
The levels are None, Error, Warn, Info, and Debug. The package’s own messages go to the Unity log, and the native SDKs’ logs to Xcode or Android Studio. On WebGL they go to the browser console. Details: Configure() notes.

Threading

Call every Encore method from the Unity main thread. Every callback, Task continuation, and event the package raises also arrives on the main thread, so you can use Unity objects in them directly.

Next steps

User management

Identify the player and set attributes

Present offers

Show the reward sheet at a moment the player earned