PaywallView

fun PaywallView(purchases: Purchases, configuration: PaywallConfiguration? = null, paywallIdentifier: String? = null, modifier: Modifier = Modifier, isIncluded: (StorePurchaseOption) -> Boolean = { true }, style: PaywallStyle = PaywallStyle(), replacement: suspend (StorePurchaseOption) -> SubscriptionReplacement? = { null }, onPurchaseCompleted: () -> Unit = {}, content: @Composable ColumnScope.() -> Unit = {})

A paywall that uses a local configuration, or a remote paywall with an optional local fallback.

The paywall owns product presentation, purchases, and restoration. The app owns navigation, tabs, toolbars, and close buttons.

Parameters

purchases

The configured Purpl instance.

configuration

The local paywall configuration, or the fallback for a remote paywall.

paywallIdentifier

The remote paywall identifier created in Purpl.

modifier

The modifier applied to the paywall.

isIncluded

Filters the catalog options to display. It does not affect entitlements or restoration.

style

The paywall colors.

replacement

Returns the existing subscription to replace for the selected option, or null for a new purchase.

onPurchaseCompleted

Called after a purchase completes.

content

Custom marketing content shown above the products.


fun PaywallView(model: PaywallModel, modifier: Modifier = Modifier, isIncluded: (StorePurchaseOption) -> Boolean = { true }, style: PaywallStyle = PaywallStyle(), replacement: suspend (StorePurchaseOption) -> SubscriptionReplacement? = { null }, onPurchaseCompleted: () -> Unit = {}, productCard: @Composable (PaywallProductContext, () -> Unit) -> Unit? = null, content: @Composable ColumnScope.() -> Unit = {})

A paywall that presents product selection, purchases, restoration, and custom content using an existing PaywallModel.

Parameters

model

The model that loads products and handles purchases.

modifier

The modifier applied to the paywall.

isIncluded

Filters the catalog options to display. It does not affect entitlements or restoration.

style

The paywall colors.

replacement

Returns the existing subscription to replace for the selected option, or null for a new purchase.

onPurchaseCompleted

Called after a purchase completes.

productCard

A custom product card, or null to use DefaultPaywallProductCard.

content

Custom marketing content shown above the products.