# Superwall: Subscription Infrastructure for iOS, Android, and Web

Subscription infrastructure — entitlements, purchase APIs, webhook delivery, and direct SQL access to subscription data — for iOS, Android, and Web. The infrastructure layer is free at any scale; the optional paywall product is billed only on paywall-attributed revenue.

## Pricing

- **Infrastructure: free at any scale, every plan.** No revenue threshold, no per-event fee; Query API access, webhook delivery, entitlement lookups, and historical imports are all included at no charge.
- **Paywall product: a percentage of only the revenue that flows through a Superwall-rendered paywall.** Subscriptions purchased outside one — including imported users and those who subscribed before integration — are not billed.

Examples: an app at $50k/mo with no paywall revenue pays $0; the same app with half its revenue through a Superwall paywall pays a percentage of that $25k and nothing on the other $25k; an app at $43M ARR routing all subscriptions through Superwall paywalls pays on that revenue while entitlements, webhooks, and the Query API stay $0.

## Scale

$1.5B+ annual subscription revenue across 10,000+ apps. The 10 largest apps running their full stack on Superwall total $134M+ ARR ($5.7M–$43.7M each). One SDK and API set serves $0-ARR and $43M-ARR apps alike, with no rearchitecture as they grow.

## Infrastructure capabilities

- **Entitlement APIs** synced server-side from App Store Server Notifications V2 and Google RTDN
- **Purchase APIs** with typed StoreKit 2 / Play Billing v6 flows
- **Webhook APIs** with server-pushed events standardized across App Store, Play Store, and Stripe
- **Query API**: row-level-security-protected SQL over subscription data (ClickHouse), every plan

Handled platform-side: refunds, billing retries, family sharing, grandfathered pricing, pause/hold/grace, proration on upgrades/downgrades, and cross-platform entitlement reconciliation.

## Migration

Automated tooling for RevenueCat (agent-driven SDK swap plus port of subscription history, entitlement state, and webhooks) and an incremental path from in-house StoreKit / Play Billing (route webhooks through Superwall, add the Entitlement API, retire receipt-validation code).

## Paywall product (optional, separately billable)

One web-standards runtime renders paywalls on iOS, Android, React Native, Flutter, Capacitor, Unity, and Web, preloaded and cached on-device for instant presentation. Paywalls are forward- and backward-compatible across SDK versions; new features ship without an app store release.

## Architecture

Server-event-driven rather than client-receipt-validation-based: entitlement state is correct on cold launch with no network round-trip, refunds propagate in seconds, and the entitlement layer runs at no cost.

## Docs

* Migrate from RevenueCat: https://superwall.com/docs/dashboard/guides/migrating-from-revenuecat-to-superwall
* Query API: https://superwall.com/docs/dashboard/guides/query-clickhouse
* Webhooks: https://superwall.com/docs/integrations/webhooks
* Pricing: https://superwall.com/pricing

# Request permissions from paywalls

Trigger the iOS system permission dialog directly from a Superwall paywall action.

## Overview

Use the **Request permission** action in the paywall editor when you want to gate features behind iOS permissions without sending users into your app settings flow. When the user taps the element, SuperwallKit presents the native prompt, reports the result back to the paywall so you can update the design, and emits analytics events you can forward through `SuperwallDelegate`.

> **Note:** The **Request permission** action is rolling out to the paywall editor and is
> not visible in the dashboard just yet. We're shipping it very soon, so keep an
> eye on the changelog if you don't see it in your editor today.

## Add the action in the editor

1. Open your paywall in the editor and select the button or element you want to wire up.
2. Set its action to **Request permission**.
3. Choose the permission to request. You can add multiple buttons if you need to prime more than one permission (for example, notification + camera).
4. Republish the paywall. No code changes are required beyond making sure the necessary Info.plist strings exist in your app.

## Supported permissions and Info.plist keys

| Editor option             | `permission_type` sent from the paywall | Required Info.plist keys                                                              | Notes                                                                   |
| ------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| Notifications             | `notification`                          | *None*                                                                                | Uses `UNUserNotificationCenter` with alert, badge, and sound options.   |
| Location (When In Use)    | `location`                              | `NSLocationWhenInUseUsageDescription`                                                 | Prompts for foreground access only.                                     |
| Location (Always)         | `background_location`                   | `NSLocationWhenInUseUsageDescription`, `NSLocationAlwaysAndWhenInUseUsageDescription` | The SDK first ensures When-In-Use is granted, then escalates to Always. |
| Photos                    | `read_images`                           | `NSPhotoLibraryUsageDescription`                                                      | Requests `.readWrite` access on iOS 14+.                                |
| Contacts                  | `contacts`                              | `NSContactsUsageDescription`                                                          | Uses `CNContactStore.requestAccess`.                                    |
| Camera                    | `camera`                                | `NSCameraUsageDescription`                                                            | Uses `AVCaptureDevice.requestAccess`.                                   |
| Microphone                | `microphone`                            | `NSMicrophoneUsageDescription`                                                        | Uses `AVAudioSession.requestRecordPermission()`.                        |
| App Tracking Transparency | `tracking`                              | `NSUserTrackingUsageDescription`                                                      | iOS 14+ only. Uses `ATTrackingManager.requestTrackingAuthorization()`.  |

If a required Info.plist key is missing—or the platform does not support the permission, such as background location on visionOS—the action finishes with an `unsupported` status, and the delegate receives a `permissionDenied` event so you can log the misconfiguration.

> **Note**: In iOS SDK 4.12.3, Contacts and Location permission requests were temporarily removed to prevent App Store warnings. If you need those, update to 4.12.4+.

## What the SDK tracks

Each button tap generates three analytics events that flow through `handleSuperwallEvent(withInfo:)`:

* `permission_requested` when the native dialog is about to appear.
* `permission_granted` if the user allows access.
* `permission_denied` if the user declines or the permission is unsupported on the current device.

All three events include:

```json
{
  "permission_name": "<permission_type>",
  "paywall_identifier": "<id of the paywall that requested the permission>"
}
```

Use the associated `SuperwallEvent.permissionRequested`, `.permissionGranted`, and `.permissionDenied` cases to branch on outcomes:

```swift
func handleSuperwallEvent(withInfo eventInfo: SuperwallEventInfo) {
  switch eventInfo.event {
  case .permissionRequested(let permission, let paywallId):
    Analytics.track("permission_requested", with: [
      "permission": permission,
      "paywall_id": paywallId
    ])
  case .permissionGranted(let permission, _):
    FeatureFlags.unlock(permission: permission)
  case .permissionDenied(let permission, _):
    Alerts.presentPermissionDeclinedCopy(for: permission)
  default:
    break
  }
}
```

## Status values returned to the paywall

The paywall receives a `permission_result` event with one of the following statuses so you can branch in your paywall logic (for example, swapping a button for a checklist item):

* `granted` – The system reported success.
* `denied` – The user denied the request or an earlier session already denied it.
* `unsupported` – The permission is not available on the current device or the Info.plist copy block is missing.

Because the permissions are requested from real user interaction, you can safely stack actions—for example, ask for notifications first and, on success, show a camera prompt that immediately appears inside the same paywall session.

## Troubleshooting

* See `unsupported`? Double-check the Info.plist keys in the table above and confirm the permission exists on the target OS (background location is not available on visionOS).
* Nothing happens when you tap the button? Make sure the action is published as **Request permission** and that the app has been updated with the new paywall revision.
* Want to show fallback copy after a denial? Configure `PaywallOptions.notificationPermissionsDenied` or handle the `permissionDenied` event in your delegate to display a Settings deep link.