Subscription Replacement

Upgrade, downgrade or switch Google Play subscriptions from an Expo paywall, and pass replacement details to a custom purchase controller.

Subscription replacement switches a user's existing Google Play subscription instead of buying a second subscription. Use it for upgrades, downgrades and plan changes on Android.

Requirements

Use Expo SDK v1.8.0 or later on Android. The user must have an active Google Play subscription that shares an entitlement with the product being purchased.

Enable replacement

Configure the paywall's Purchase action to replace the existing subscription. Superwall handles the replacement when using its built-in purchase flow.

With a custom purchase controller, Android onPurchase receives an optional replacement. Pass oldPurchaseToken and mode to your billing library's subscription update parameters. The compatibility API receives the same object as the optional fourth argument:

purchaseFromGooglePlay(
  productId: string,
  basePlanId?: string,
  offerId?: string,
  replacement?: ProductReplacement,
): Promise<PurchaseResult>

ProductReplacement

Prop

Type

Limitations

Android only. replacement is absent for a normal purchase. Custom controllers must implement the switch in their billing library; ignoring the object can purchase a second subscription. Handle missing old subscription identifiers or tokens as a failed purchase rather than silently buying alongside it.

The offerId is already selected by Superwall. If it is null or undefined, buy the base plan without an offer, including when replacing a subscription.

How is this guide?

On this page