EncorePurchaseController your app registers with configure(). The SDK has no built-in billing and never runs purchase code you did not write: your controller owns product lookup, receipt validation, restore handling, and entitlement bookkeeping, exactly as it does for every other purchase in your app.
Encore controls when a purchase happens; you own how.
Definition
- Throwing records a failure. A throw lands on the result as
EncorePublisherOutcome.failed, and the flow continues. Map your billing layer’s “user cancelled” error tocancelledrather than throwing it. - An unrecognized answer is a failure, never
purchased, because a phantom success would grant access nobody paid for. - The controller survives
reset(). It is app-level wiring, not user state.
EncorePurchaseRequest
What your controller receives when Encore needs a purchase.Android’s native controller also hands over the foreground
Activity. The plugin keeps it on the native side, since it is valid only for the duration of the call, so one Dart contract covers both platforms.Implementations
- RevenueCat
- Custom
Related
- configure(): accepts the controller, and defines what happens when none is registered
- EncorePresentationResult: where the controller’s answer lands as
publisher