# PaywallOptions

Configuration for paywall presentation and behavior in the Superwall iOS SDK.

> **Tip**

`PaywallOptions` is provided via the `paywalls` property on [`SuperwallOptions`](/docs/ios/sdk-reference/SuperwallOptions) and is passed when calling [`configure`](/docs/ios/sdk-reference/configure).



Purpose [#purpose]

Customize how paywalls look and behave, including preload behavior, alerts, dismissal, and haptics.

Signature [#signature]

```swift
@objcMembers
public final class PaywallOptions: NSObject {
  public var isHapticFeedbackEnabled: Bool = true

  public final class RestoreFailed: NSObject {
    public var title: String = "No Subscription Found"
    public var message: String = "We couldn't find an active subscription for your account."
    public var closeButtonTitle: String = "Okay"
  }
  public var restoreFailed: RestoreFailed = RestoreFailed()

  public var shouldShowWebRestorationAlert: Bool = true

  public final class NotificationPermissionsDenied: NSObject {
    public var title: String = "Notification Permissions Denied"
    public var message: String = "Please enable notification permissions from the Settings app so we can notify you when your free trial ends."
    public var actionButtonTitle: String = "Open Settings"
    public var closeButtonTitle: String = "Not now"
  }
  public var notificationPermissionsDenied: NotificationPermissionsDenied?

  public var shouldShowPurchaseFailureAlert: Bool = true
  public var shouldPreload: Bool = true
  public var automaticallyDismiss: Bool = true

  public var overrideProductsByName: [String: String]? = [:]
  public var shouldShowWebPurchaseConfirmationAlert: Bool = true

  public enum TransactionBackgroundView: Int {
    case spinner
    case none
  }
  public var transactionBackgroundView: TransactionBackgroundView = .spinner
}
```

Parameters [#parameters]

<TypeTable
  type="{
  isHapticFeedbackEnabled: {
    type: &#x22;Bool&#x22;,
    description: &#x22;Enables haptic feedback during key paywall interactions.&#x22;,
    default: &#x22;true&#x22;,
  },
  restoreFailed: {
    type: &#x22;RestoreFailed&#x22;,
    description: &#x22;Messaging for the restore-failed alert.&#x22;,
    required: true,
  },
  &#x22;restoreFailed.title&#x22;: {
    type: &#x22;String&#x22;,
    description: &#x22;Title for restore-failed alert.&#x22;,
    default: &#x22;No Subscription Found&#x22;,
  },
  &#x22;restoreFailed.message&#x22;: {
    type: &#x22;String&#x22;,
    description: &#x22;Message for restore-failed alert.&#x22;,
    default: &#x22;We couldn't find an active subscription for your account.&#x22;,
  },
  &#x22;restoreFailed.closeButtonTitle&#x22;: {
    type: &#x22;String&#x22;,
    description: &#x22;Close button title for restore-failed alert.&#x22;,
    default: &#x22;Okay&#x22;,
  },
  shouldShowWebRestorationAlert: {
    type: &#x22;Bool&#x22;,
    description: &#x22;Shows an alert asking the user to try restoring on the web if web checkout is enabled.&#x22;,
    default: &#x22;true&#x22;,
  },
  notificationPermissionsDenied: {
    type: &#x22;NotificationPermissionsDenied?&#x22;,
    description: &#x22;Customize the alert shown when notification permissions are denied. `nil` disables the alert.&#x22;,
  },
  &#x22;notificationPermissionsDenied.title&#x22;: {
    type: &#x22;String&#x22;,
    description: &#x22;Title for notification-permissions-denied alert.&#x22;,
    default: &#x22;Notification Permissions Denied&#x22;,
  },
  &#x22;notificationPermissionsDenied.message&#x22;: {
    type: &#x22;String&#x22;,
    description: &#x22;Message for notification-permissions-denied alert.&#x22;,
    required: true,
  },
  &#x22;notificationPermissionsDenied.actionButtonTitle&#x22;: {
    type: &#x22;String&#x22;,
    description: &#x22;Action button title for notification-permissions-denied alert.&#x22;,
    default: &#x22;Open Settings&#x22;,
  },
  &#x22;notificationPermissionsDenied.closeButtonTitle&#x22;: {
    type: &#x22;String&#x22;,
    description: &#x22;Close button title for notification-permissions-denied alert.&#x22;,
    default: &#x22;Not now&#x22;,
  },
  shouldShowPurchaseFailureAlert: {
    type: &#x22;Bool&#x22;,
    description: &#x22;Shows an alert after a purchase fails. Set to `false` if you handle failures via a `PurchaseController`.&#x22;,
    default: &#x22;true&#x22;,
  },
  shouldPreload: {
    type: &#x22;Bool&#x22;,
    description: &#x22;Preloads and caches trigger paywalls and products during SDK initialization.&#x22;,
    default: &#x22;true&#x22;,
  },
  automaticallyDismiss: {
    type: &#x22;Bool&#x22;,
    description: &#x22;Automatically dismisses the paywall on successful purchase or restore.&#x22;,
    default: &#x22;true&#x22;,
  },
  overrideProductsByName: {
    type: &#x22;[String: String]?&#x22;,
    description: &#x22;Overrides products on all paywalls using name\u2192identifier mapping (e.g., `\&#x22;primary\&#x22;` \u2192 `\&#x22;com.example.premium_monthly\&#x22;`).&#x22;,
  },
  shouldShowWebPurchaseConfirmationAlert: {
    type: &#x22;Bool&#x22;,
    description: &#x22;Shows a localized alert confirming a successful web checkout purchase.&#x22;,
    default: &#x22;true&#x22;,
  },
  transactionBackgroundView: {
    type: &#x22;TransactionBackgroundView&#x22;,
    description: &#x22;View shown behind the system payment sheet during a transaction. `.spinner` by default; set to `.none` to remove.&#x22;,
  },
}"
/>

Usage [#usage]

```swift
let paywallOptions = PaywallOptions()
paywallOptions.isHapticFeedbackEnabled = true
paywallOptions.shouldShowPurchaseFailureAlert = false
paywallOptions.shouldPreload = true
paywallOptions.automaticallyDismiss = true
paywallOptions.transactionBackgroundView = .spinner
paywallOptions.overrideProductsByName = [
  "primary": "com.example.premium_monthly",
  "tertiary": "com.example.premium_annual"
]
paywallOptions.shouldShowWebRestorationAlert = true
paywallOptions.notificationPermissionsDenied = {
  let n = PaywallOptions.NotificationPermissionsDenied()
  n.title = "Notification Permissions Denied"
  n.message = "Please enable notification permissions from the Settings app so we can notify you when your free trial ends."
  n.actionButtonTitle = "Open Settings"
  n.closeButtonTitle = "Not now"
  return n
}()

let options = SuperwallOptions()
options.paywalls = paywallOptions

Superwall.configure(
  apiKey: "pk_your_api_key",
  options: options
)
```

Related [#related]

* [`SuperwallOptions`](/docs/ios/sdk-reference/SuperwallOptions)