Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Available tap actions are:
2. **Written Review:** This option deeplinks to the repspective App Store so the user can write a written review.
- **Custom Action:** Performs a custom action that you specify. Using custom actions, you can tie application logic to anything tapped or clicked on your paywall. Check out the docs [here](/custom-paywall-events).
- **Custom Placement:** Registers the placement you specify in the **Name** field. One common use-case is presenting another paywall from a currently opened one. Check out the example [here](/presenting-paywalls-from-one-another).
- **Delay:** Pauses the action chain for a specified number of **Seconds** before continuing to the next action. This is useful when you have multiple actions on a single tap and want to space them out. For example, setting a variable and then closing the paywall after a short pause. The **Interruptible** option controls what happens if the user taps the same element again while a delay is pending: **Yes** cancels the current delay and restarts the action chain, while **No** ignores the tap until the delay completes.
- **Delay:** Pauses the action chain for a specified number of **Seconds** before continuing to the next action. This is useful when you have multiple actions on a single tap and want to space them out. For example, setting a variable and then closing the paywall after a short pause. It's also useful for driving animation states or creating auto-advance timers. The **Interruptible** option controls what happens if the user taps the same element again while a delay is pending: **Yes** cancels the current delay and restarts the action chain, while **No** ignores the tap until the delay completes.
- **Custom Callback:** Sends a named callback request to the SDK, allowing you to run custom app logic and respond with a result. Enter a **Name** for the callback and choose a **Behavior**: **Blocking** waits for the SDK to respond before continuing the action chain, while **Non-blocking** fires the request and continues immediately. You can pass paywall variables to the SDK using **+ Add Variable**. Use the **On Success** and **On Failure** sections to add follow-up actions that run depending on the SDK's response. For example, you could validate something in your app and then update a variable or close the paywall based on the result. _Requires iOS SDK v4.12.10+ or Android SDK v2.7.0+._

If a component has a tap action associated to it, you'll also see a **triangle** icon next to it within the sidebar:
Expand Down
Binary file added content/docs/images/test_mode_active.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/docs/images/test_mode_purchase.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions content/docs/ios/guides/test-mode.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: "Test Mode"
description: "Simulate in-app purchases without StoreKit using test mode, which lets you test your entire paywall flow end-to-end."
---

Test mode lets you simulate in-app purchases without involving StoreKit or any external purchase controller. When active, all purchases are faked and product data is retrieved from the Superwall dashboard. This makes it easy to test your entire paywall flow end-to-end, including purchase, restore, and entitlement changes, without needing a StoreKit configuration file or sandbox account.

<Frame caption="The test mode modal appears on launch when test mode is active.">![](/images/test_mode_active.jpg)</Frame>

## How it works

When test mode is active:

- **Product data comes from the dashboard** instead of StoreKit, so you don't need a StoreKit configuration file or App Store Connect products set up.
- **Purchases are simulated.** Instead of the system payment sheet, a test mode drawer appears letting you choose to complete, abandon, or fail the transaction. All purchase events fire normally, so your analytics and delegate callbacks work as expected.
- **Restores are simulated.** A restore drawer lets you pick which entitlements to restore.
- **A configuration modal** appears on launch showing your User ID, purchase controller status, device and user attributes, free trial override, and starting entitlements. You can use this to configure the test session before interacting with your paywalls.
- **All events route to sandbox**, so test mode activity won't affect your production data.

## Activating test mode

There are two ways to activate test mode:

### 1. From the dashboard

Mark specific users as **test store users** in the Superwall dashboard. When the SDK detects that the current user's ID matches a test store user from your config, test mode activates automatically. This is the most common approach.

### 2. From the SDK

Set `testModeBehavior` on `SuperwallOptions` before calling `configure`:

```swift
let options = SuperwallOptions()
options.testModeBehavior = .always

Superwall.configure(apiKey: "your-api-key", options: options)
```

The available behaviors are:

| Behavior | Description |
| --- | --- |
| `.automatic` | **(Default)** Activates when the current user is marked as a test store user in the dashboard, or when the app's bundle ID doesn't match the one configured in the dashboard. Never activates during UI tests. |
| `.whenEnabledForUser` | Activates only when the current user is marked as a test store user in the dashboard. Ignores bundle ID mismatches. |
| `.always` | Always activates test mode, regardless of dashboard configuration. Useful during local development. |
| `.never` | Never activates test mode, regardless of configuration. |

## The configuration modal

When test mode activates, a modal appears before you interact with any paywalls. It displays:

- **User ID:** Your current user ID, with a link to view the user in the dashboard.
- **Purchase Controller:** Whether you've provided a custom purchase controller.
- **Device Attributes:** Tap to view all device-level attributes the SDK is tracking.
- **User Attributes:** Tap to view all user-level attributes.
- **Free Trial Override:** Override free trial availability for all products. Choose **Use Default** (respects the product's actual trial status), **Force Available**, or **Force Unavailable**.
- **Starting Entitlements:** If you have entitlements configured, you can set each one to **Active** or **Inactive** before dismissing the modal. This lets you test how your paywalls behave for users with different entitlement states.

Tap **OK** to dismiss the modal and begin testing. Your selections persist across sessions. Tap **Reset to Defaults** to clear all overrides.

## Simulating purchases

When you tap a purchase button on a paywall while test mode is active, a drawer appears instead of the system payment sheet:

<Frame>![](/images/test_mode_purchase.jpg)</Frame>

The drawer shows the product details and these options:

- **Purchase:** Simulates a successful purchase. The product's entitlements are activated and your subscription status updates accordingly.
- **Failure:** Simulates a purchase failure.

All standard Superwall events (`transaction_start`, `transaction_complete`, `transaction_abandon`, `transaction_fail`, etc.) fire as they normally would, so you can verify your analytics and delegate callbacks.


## Simulating restores

When a restore is triggered while test mode is active, a drawer appears letting you select which entitlements to restore and in what state. This is useful for testing how your app handles different restore scenarios.

## When to use test mode vs. StoreKit testing

| | Test mode | StoreKit testing |
| --- | --- | --- |
| **Setup** | No StoreKit config file needed | Requires a StoreKit configuration file in Xcode |
| **Products** | Pulled from the Superwall dashboard | Must exist in the StoreKit config or App Store Connect |
| **Transactions** | Simulated via UI drawer | Real StoreKit transactions in a sandbox |
| **Best for** | End-to-end paywall flow testing, verifying entitlement gating, testing without App Store Connect setup | Testing real StoreKit behavior, receipt validation, subscription lifecycle |

Test mode is ideal for quickly validating your paywall presentation, purchase flows, and entitlement gating without any StoreKit setup. For testing actual StoreKit behavior, use [StoreKit testing in Xcode](/testing-purchases) instead.
1 change: 1 addition & 0 deletions content/docs/ios/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"guides/using-revenuecat",
"guides/experimental-flags",
"guides/testing-purchases",
"guides/test-mode",
"guides/embedded-paywalls-in-scrollviews",
"guides/superwall-deep-links",
"guides/app-privacy-nutrition-labels",
Expand Down
79 changes: 78 additions & 1 deletion src/lib/changelog-entries.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,83 @@
{
"lastUpdated": "2026-02-18T18:31:03.599Z",
"lastUpdated": "2026-02-19T17:46:40.862Z",
"entries": [
{
"key": "content/docs/ios/guides/test-mode.mdx:ab65878499ce2ae1e2bd0afc2be7b48c3b358e46",
"path": "ios/guides/test-mode.mdx",
"title": "Test Mode",
"description": "Introduces test mode for simulating in-app purchases and testing paywall flows without StoreKit.",
"category": "iOS SDK",
"subcategory": "Guides",
"url": "/docs/ios/guides/test-mode",
"date": "2026-02-18T20:41:39.000Z",
"changeType": "added"
},
{
"key": "content/docs/dashboard/dashboard-creating-paywalls/paywall-editor-styling-elements.mdx:eab2b3da7bff2d08535e38529df8074924ea0958",
"path": "dashboard/dashboard-creating-paywalls/paywall-editor-styling-elements.mdx",
"title": "Styling Elements",
"description": "Adds details on using delay action for animation states and auto-advance timers in paywalls.",
"category": "Dashboard",
"subcategory": "Creating Paywalls",
"url": "/docs/dashboard/dashboard-creating-paywalls/paywall-editor-styling-elements",
"date": "2026-02-18T20:13:41.000Z",
"changeType": "modified"
},
{
"key": "content/docs/ios/guides/handling-deep-links.mdx:05584108877e66b191dc3aa172888473c80e79b8",
"path": "ios/guides/handling-deep-links.mdx",
"title": "Handling Deep Links",
"description": "Explains how to use deep links for dynamically presenting paywalls in iOS apps.",
"category": "iOS SDK",
"subcategory": "Guides",
"url": "/docs/ios/guides/handling-deep-links",
"date": "2026-02-18T19:54:06.000Z",
"changeType": "added"
},
{
"key": "content/docs/android/guides/handling-deep-links.mdx:05584108877e66b191dc3aa172888473c80e79b8",
"path": "android/guides/handling-deep-links.mdx",
"title": "Handling Deep Links",
"description": "Added guide for presenting paywalls from deep links without hardcoding app logic.",
"category": "Android SDK",
"subcategory": "Guides",
"url": "/docs/android/guides/handling-deep-links",
"date": "2026-02-18T19:54:06.000Z",
"changeType": "added"
},
{
"key": "content/docs/flutter/guides/handling-deep-links.mdx:05584108877e66b191dc3aa172888473c80e79b8",
"path": "flutter/guides/handling-deep-links.mdx",
"title": "Handling Deep Links",
"description": "Learn how to handle deep links and paywalls without hardcoding complex routing logic.",
"category": "Flutter SDK",
"subcategory": "Guides",
"url": "/docs/flutter/guides/handling-deep-links",
"date": "2026-02-18T19:54:06.000Z",
"changeType": "added"
},
{
"key": "content/docs/expo/guides/handling-deep-links.mdx:05584108877e66b191dc3aa172888473c80e79b8",
"path": "expo/guides/handling-deep-links.mdx",
"title": "Handling Deep Links",
"description": "Learn how to handle deep links and present paywalls dynamically without hardcoding app logic.",
"category": "Expo SDK",
"subcategory": "Guides",
"url": "/docs/expo/guides/handling-deep-links",
"date": "2026-02-18T19:54:06.000Z",
"changeType": "added"
},
{
"key": "content/docs/dashboard/guides/superwall-mcp.mdx:05584108877e66b191dc3aa172888473c80e79b8",
"path": "dashboard/guides/superwall-mcp.mdx",
"title": "Superwall MCP",
"description": "Introduces Superwall MCP, enabling AI agents to manage Superwall projects and resources directly.",
"category": "Dashboard",
"subcategory": "Guides",
"url": "/docs/dashboard/guides/superwall-mcp",
"date": "2026-02-18T19:54:06.000Z",
"changeType": "added"
},
{
"key": "content/docs/ios/guides/handling-deep-links.mdx:05a92e49728094baaf0e49e70efc59fabf0403a7",
"path": "ios/guides/handling-deep-links.mdx",
Expand Down