# 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

# Push Notifications

Register FCM tokens with Superwall, manage device notification preferences, and measure notification opens from your Android app.

Register your app's Firebase Cloud Messaging (FCM) token with Superwall so it can send push notifications to the device. Use this when integrating Superwall notification campaigns with an existing Android notification flow.

## Requirements

* Superwall Android SDK 2.10.0 or later.
* FCM configured in your app and Superwall notifications enabled for your app.
* Call `Superwall.configure` before using `Superwall.instance`.

The SDK has no Firebase dependency and does not request notification permission for this integration. Your app owns Firebase setup and permission requests.

## Register the device token

After configuring Superwall, retrieve the current token at startup:

```kotlin
import com.google.firebase.messaging.FirebaseMessaging
import com.superwall.sdk.Superwall

FirebaseMessaging.getInstance().token.addOnSuccessListener { token ->
    Superwall.instance.setPushToken(token)
}
```

Also forward new tokens from `FirebaseMessagingService.onNewToken`. If the service can run before your app configures Superwall, persist the token in your app and forward it after configuration; accessing `Superwall.instance` before configuration throws.

```kotlin
// Only when Superwall is already configured:
override fun onNewToken(token: String) {
    Superwall.instance.setPushToken(token)
}
```

It's safe to register on every launch. The SDK sends changes to the token, notification permission, device preference, or user identity, and otherwise refreshes unchanged state at most once a day. Notification permission is checked again when the app enters the foreground.

## Manage notification preferences

Devices are opted in by default. Use these methods to change the device's preference for Superwall notifications:

```kotlin
Superwall.instance.optOutOfNotifications()
Superwall.instance.optInToNotifications()
```

The preference survives app launches, `reset()`, and `identify(userId)`. It does not change the Android system notification permission.

## Measure notification opens

Pass the intent that opened your Activity from a notification tap to Superwall, for example from `onCreate` or `onNewIntent` after configuration:

```kotlin
Superwall.instance.handleNotificationOpen(intent)
```

For notifications FCM displays itself, the tap intent already carries the data keys. If your app builds its own notification in `onMessageReceived`, copy the `sw` data value to the intent used by its tap `PendingIntent`:

```kotlin
val tapIntent = Intent(this, MainActivity::class.java)
    .putExtra("sw", message.data["sw"])
```

If your tap handler has the notification's data map instead, use:

```kotlin
Superwall.instance.handleNotificationOpen(data) // Map<String, String>
```

Call these methods only when the user taps a notification. Calling them on delivery in `onMessageReceived` would count deliveries as opens. Notifications not sent by Superwall are ignored.

## Limitations

Token registration is retained locally until Superwall notifications are enabled for the app. Nothing is sent while `eventTrackingBehavior` is `NONE`. The token travels only to Superwall's servers; it does not appear in delegate analytics callbacks, delegate logs, user attributes, or audience filters.

## Related

* [Superwall reference](/docs/android/sdk-reference/Superwall#push-notifications)
* [Configuring the SDK](/docs/android/quickstart/configure)
* [SuperwallOptions](/docs/android/sdk-reference/SuperwallOptions)