Skip to main content
Configures the shared Encore instance for use throughout your app. This must be called once, typically in your AppDelegate or SwiftUI App initializer, before using any other SDK methods.
Call configure() before using any other SDK methods. Failure to do so makes show() resolve with .notPresented(.notConfigured) and other APIs report EncoreError.integration(.notConfigured).

Signature

Options bundles the SDK’s runtime settings:

Parameters

The SDK has no built-in billing. If a subscription product is configured for your app but no controller is registered, the claim completes with publisher: .notAttempted, a warning is logged naming the product, and the sdk_iap_no_purchase_controller analytics event is emitted. 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.

Options

Unlock mode

UnlockMode controls when the SDK grants an entitlement after the user returns from an offer:

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 sells a product through Encore offers, register your EncorePurchaseController at configure time so purchases run through your billing code:

SwiftUI

Development builds

Pair the test key with logLevel: .debug so development builds serve the demo catalog and log verbosely, while production builds keep the live key and stay silent: