Skip to main content

Overview

Encore works alongside Superwall so you can present retention offers at key moments in your paywall flow.

Presenting Offers

Option 1: On Paywall Dismissal

Trigger Encore when a user dismisses your Superwall paywall without converting:
import SuperwallKit
import Encore

// Listen to Superwall's paywall dismissal
class SWDelegate: SuperwallDelegate {
    func willDismissPaywall(withInfo paywallInfo: PaywallInfo) {
        // User dismissed without purchasing
        Encore.placement().show()
    }
}
Use the same fluent API documented here: placement()

Option 2: Custom Paywall Action

Create/Update the Superwall delegate to handle custom actions from your paywall:
import SuperwallKit
import Encore

// Listen to Superwall's custom actions
class SWDelegate: SuperwallDelegate {
    func handleCustomPaywallAction(withName name: String) {
        // Action is EncoreTrigger
        if name == "EncoreTrigger" {
            Encore.placement()
                .onGranted { entitlements in
                    Superwall.shared.dismiss()
                }
                .onNotGranted { reason in
                    Superwall.shared.dismiss()
                }
                .show()
        }
    }
}
Then, in the Superwall editor, add a custom action named “EncoreTrigger” to any button or element in your paywall.
Use the same fluent API documented here: placement()