Purpose
Create and present Encore offers using a fluent API that fits naturally in SwiftUI and UIKit. Purchase handling and passthrough logic are managed by app-level handlers — see onPurchaseRequest().Signature
Methods
| Method | Parameters | Description |
|---|---|---|
placement() | id: String? | Creates a placement with optional identifier. If omitted, auto-generates unique ID |
show() | None | Presents the offer sheet modally |
show() async | None | Presents the offer and returns EncorePresentationResult or throws EncoreError |
Returns / State
placement() returns a Placement instance. Call show() to present. Purchase outcomes are delegated to your onPurchaseRequest() and onPassthrough() handlers.
Usage Patterns
Cancellation Flow
Async/Await Pattern
Passive Offer (No Callbacks)
When you don’t need custom flow control, you can present with no callbacks. The SDK automatically manages entitlement state through
isActivePublisher(). Purchases are handled by your registered onPurchaseRequest() handler.