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 test offers from any location without geo-filtering restrictions. This makes it easy to test the entire entitlement lifecycle end-to-end for a single user.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 bypass geo-filtering and log verbosely, while production builds keep the live key and stay silent: