Skip to main content

Overview

Encore works alongside Adapty so you can present retention offers at key moments in your app. Since Adapty doesn’t include a built-in paywall component, you present Encore offers directly using Encore.placement().show().
Adapty handles subscription management, analytics, and attribution. Encore handles retention offer presentation and purchase delegation.

Handle Offer Results

Register handlers at app launch so Encore can delegate purchases to Adapty.

Register onPurchaseRequest

Encore.shared.onPurchaseRequest { productId, placementId in
    let products = try await Adapty.getPaywallProducts(paywall: paywall)
    guard let product = products.first(where: { $0.vendorProductId == productId }) else { return }
    try await Adapty.makePurchase(product: product)
}
See onPurchaseRequest() for complete API details and examples with other subscription managers.

Register onPassthrough

Called when the user dismisses the offer or no offers are available. Use this to resume the user’s original action.
Encore.shared.onPassthrough { placementId in
    // Resume your original user flow
}

Alternative: Automatic StoreKit Purchase

If you don’t set onPurchaseRequest, Encore purchases via native StoreKit 2 automatically. You must manually report each transaction to Adapty so it can track entitlements.

Setup

  1. Configure Adapty SDK in observer mode:
try await Adapty.activate(with: .builder(withAPIKey: "YOUR_KEY")
    .with(observerMode: true)
    .build()
)
  1. Register onPurchaseComplete to report transactions:
Encore.shared.onPurchaseComplete { transaction, productId in
    try? await Adapty.reportTransaction(transaction)
}
Adapty SDK 3.3+ in observer mode requires manual reportTransaction() calls for StoreKit 2 transactions.

Configure Analytics

Encore Webhook

Encore uses Apple’s App Store Server Notifications to track subscription lifecycle events and measure offer impact. See Configure Analytics for full setup instructions.
If Adapty already occupies your primary App Store Server Notifications URL, use the Forward from Your Server option to send notifications to both Adapty and Encore.

Adapty Webhook

If you’re using the Automatic StoreKit Purchase approach above, Adapty also needs to receive App Store Server Notifications to track renewals and refunds. In App Store Connect, add the ASSN V2 webhook URL from your Adapty Dashboard. If Encore is your primary URL, forward notifications to Adapty from your server.