Skip to main content

Overview

Present Encore retention offers when users dismiss your RevenueCat paywall without converting.

Presenting Offers

Option 1: Using PaywallView

If you’re using RevenueCat’s PaywallView component, use the onRequestDismiss callback to trigger Encore:
import RevenueCat
import RevenueCatUI
import Encore

PaywallView(
    placement: "your_placement",
    params: [String: Any]?,
    paywallOverrides: PaywallOverrides?,
    onRequestDismiss: { paywallInfo, paywallResult in
        // User dismissed without purchasing - trigger Encore
        Encore.placement().show()
    },
    feature: (() -> Void)?
)

Option 2: Using presentPaywallIfNeeded Modifier

If you’re using the .presentPaywallIfNeeded modifier, use the onDismiss callback:
import RevenueCat
import RevenueCatUI
import Encore

YourView()
    .presentPaywallIfNeeded(
        presentationMode: {.fullScreen, .sheet, .default},
        onDismiss: {
            // User dismissed without purchasing - trigger Encore
            Encore.placement().show()
        }
    )
See the SDK Reference for complete API details: placement() and onPurchaseRequest()

Handle Offer Results

Register RevenueCat as your purchase handler at app launch so Encore delegates purchases automatically.

Register onPurchaseRequest

Encore.shared.onPurchaseRequest { purchaseRequest in
    let products = try await Purchases.shared.products([purchaseRequest.productId])
    guard let product = products.first else { return }
    try await Purchases.shared.purchase(product: product)
}

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. RevenueCat can auto-detect these transactions when configured in observer mode.

Setup

  1. Configure RevenueCat to observe external purchases:
Purchases.configure(
    with: .builder(withAPIKey: "YOUR_RC_KEY")
        .with(purchasesAreCompletedBy: .myApp, storeKitVersion: .storeKit2)
        .build()
)
No onPurchaseComplete handler is needed — RevenueCat auto-detects StoreKit transactions in observer mode.

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 RevenueCat already occupies your primary App Store Server Notifications URL, use the Forward from Your Server option to send notifications to both RevenueCat and Encore.

RevenueCat Webhook

If you’re using the Automatic StoreKit Purchase approach above, RevenueCat also needs to receive App Store Server Notifications to track transactions. In the RevenueCat Dashboard:
  • Upload your App Store IAP Key
  • Enable “Track new purchases from S2S notifications”
In App Store Connect, add the ASSN V2 webhook URL from your RevenueCat Dashboard. If Encore is your primary URL, forward notifications to RevenueCat from your server.