Skip to main content
Configures the shared Encore instance for use throughout your app. This must be called once, typically in your Application.onCreate(), before using any other SDK methods.
Call configure() before using any other SDK methods. Until then, show() resolves to NotPresented(NotConfigured) and other calls log EncoreError.Integration.NotConfigured. A second call logs a warning and returns without applying anything, so every argument, including the purchase controller, must be passed to the first call.

Signature

Parameters

The SDK has no built-in billing. If a subscription product is configured for your app but no controller is registered, the result records PublisherOutcome.NotAttempted, a warning is logged naming the product, and the sdk_iap_no_purchase_controller analytics event is emitted. Nothing is ever charged. See EncorePurchaseController.
Registering a controller is build-time wiring, not user state: it survives reset(), so logging a user out does not require re-registering.

Unlock modes

The mode selects how a claim flow runs, never how a result is read, and the SDK computes no verdict over the record; hosts branch on the raw axes. Optimistic records Claimed; Verified is reachable only under Strict, where an in-sheet poll can upgrade the axis in-session. With UnlockMode.Strict, a claim that ends unverified in-session is persisted and re-checked on later launches and foregrounds until the server settles it, surfacing on Encore.outcomes as PlacementOutcome.StrictUnlockVerified. Pending claims are cleared by reset() and by identify() with a different user, and never grant anything by themselves.

Log levels

Higher levels include all lower levels. For example, INFO will also show warnings and errors.

API keys

Encore supports two types of 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. The test key is for development and testing only.

Usage

Basic configuration

With a purchase controller

If your app has a subscription product configured, register the controller here. Registration is build-time wiring, not user state: it survives reset().
See EncorePurchaseController for the contract and complete implementations.

With debug logging (development)

Use LogLevel.DEBUG during development to see detailed SDK logs, then use LogLevel.NONE for production builds.