Restoring Purchases

Let users restore App Store and Google Play purchases with Superwall: add a Restore button to a paywall, call restorePurchases() from your app, customize the failure alert, and restore with a purchase controller.

Restoring gives a user back access they already paid for, for example after they reinstall your app or move to a new phone. Superwall can restore from a button on your paywall, or from anywhere in your app with one SDK call. Apple requires apps with in-app purchases to offer a way to restore them.

Add a Restore button to a paywall

  1. In the paywall editor, select the button or text you want users to tap.
  2. Under Tap Behavior, choose Restore.
  3. Publish the paywall.

When the user taps it, the SDK shows a loading state and restores their purchases with the App Store or Google Play:

  • If the restore gives the user an active entitlement, the SDK tracks a restoreComplete event and dismisses the paywall. To keep the paywall open, set automaticallyDismiss to false in SuperwallOptions.paywalls.
  • If it doesn't, the SDK tracks a restoreFail event and shows an alert: "No Subscription Found. We couldn't find an active subscription for your account."

A restore counts as successful only when the user ends up with an active entitlement, so a user whose subscription has expired gets the alert.

Restore from your app

To restore from your own settings screen or purchase UI, call restorePurchases():

let result = await Superwall.shared.restorePurchases()
val result = Superwall.instance.restorePurchases()
final result = await Superwall.shared.restorePurchases();
const { restorePurchases } = useSuperwall();
const result = await restorePurchases();

The result says whether the restore itself succeeded, not whether the user is subscribed. Check the user's subscription status after it returns. If you don't use a purchase controller and the user has no active entitlement, the SDK shows the same alert as the paywall's Restore button.

Restoring can ask the user to sign in to their App Store or Google account, so only restore when the user asks to.

Customize the failure alert

Change the alert's text with restoreFailed in SuperwallOptions.paywalls:

let options = SuperwallOptions()
options.paywalls.restoreFailed.title = "No purchases found"
options.paywalls.restoreFailed.message = "Sign in with the account you used to subscribe."
options.paywalls.restoreFailed.closeButtonTitle = "OK"
Superwall.configure(apiKey: "MY_API_KEY", options: options)
val options = SuperwallOptions()
options.paywalls.restoreFailed.title = "No purchases found"
options.paywalls.restoreFailed.message = "Sign in with the account you used to subscribe."
options.paywalls.restoreFailed.closeButtonTitle = "OK"
Superwall.configure(this, apiKey = "MY_API_KEY", options = options)

For the other SDKs, see SuperwallOptions.

Restore with a purchase controller

If you handle purchases yourself with a purchase controller, the SDK calls your controller's restorePurchases() when the user taps Restore. Restore with your own code, update the user's subscription status, and then return the result:

func restorePurchases() async -> RestorationResult {
  // Restore with StoreKit or your purchase SDK, then set
  // Superwall.shared.subscriptionStatus before returning.
  return .restored // Or .failed(error)
}
override suspend fun restorePurchases(): RestorationResult {
  // Restore with Google Play Billing or your purchase SDK, then set
  // Superwall.instance.setSubscriptionStatus(...) before returning.
  return RestorationResult.Restored() // Or RestorationResult.Failed(error)
}

Set the subscription status before you return restored. The SDK checks it right away, and if the user has no active entitlement yet, it treats the restore as failed and shows the alert.

If you use RevenueCat, see Using RevenueCat.

Restoring web checkout purchases

If your app sells through Web Checkout, a store restore doesn't find web purchases. When the store restore doesn't cover the paywall's products, the SDK asks the user whether they'd like to restore on the web. Turn this alert off with shouldShowWebRestorationAlert in SuperwallOptions.paywalls. For how web purchases are restored, see Restoring & Managing Purchases.

Test a restore

How is this guide?

On this page