AppDelegate or SwiftUI App initializer, before using any other SDK methods.
Signature
Options bundles the SDK’s runtime settings:
Parameters
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.Usage
Basic Configuration
With a purchase controller
If your app sells a product through Encore offers, register yourEncorePurchaseController at configure time so purchases run through your billing code:
SwiftUI
Development builds
Pair the test key withlogLevel: .debug so development builds serve the demo catalog and log verbosely, while production builds keep the live key and stay silent: