Skip to main content
Configures the shared Encore instance for use throughout your app. Call it once, at app startup, before any other SDK method. If your Encore flows include an in-app purchase, pass your purchase controller here. Both native SDKs bind the controller inside configure and expose no setter afterwards, so this is the only place to register it.

Signature

Parameters

EncoreLogLevel

Use EncoreLogLevel.debug during development to see detailed native logs, then EncoreLogLevel.none for production builds.

EncoreUnlockMode

Set once, at configure. It selects how a claim flow runs, never how a result is read: the presentation record is written identically in both modes.

API keys

Use the test key (pk_test_...) during development to exercise the entire entitlement lifecycle end to end. It serves a demo catalog, so the claim, the advertiser page, and the unlock all work without a live campaign or a real payout.Your own offers do not appear under a test key. For that, use the live key and accept that the traffic is recorded. See what a test key serves.
Always use your live key (pk_live_...) in production builds.

Usage

Calling configure more than once

Call configure() exactly once. Repeat calls are not safe to rely on:
  • Android ignores a repeat call entirely, controller included, so a controller the first call omitted can never be added.
  • A repeat call without a controller clears the Dart-side controller while the native side still routes purchases to the plugin, so every later purchase records EncorePublisherOutcome.failed.

Configuring without a purchase controller

If your Encore flows include no in-app purchase, omit the argument. The SDK then never attempts a purchase, and every presentation records EncorePublisherOutcome.notAttempted. That is a supported configuration.
Methods called before configure() do nothing: identify(), setUserAttributes(), and reset() complete without effect, and show() resolves EncoreNotPresented with EncoreNotPresentedReason.notConfigured.