SlideToPurchases

fun SlideToPurchases(storeProduct: StoreProduct, modifier: Modifier = Modifier, colors: SlideToUnlockColors = DefaultSlideToUnlockColors(), hintTexts: HintTexts = HintTexts.defaultHintTexts().copy(defaultText = "Slide to purchase"), onSlideCompleted: () -> Unit = {}, onPurchaseStateChanged: (PurchaseState) -> Unit = {}, isPersonalizedPrice: Boolean? = null, oldProductId: String? = null, replacementMode: GoogleReplacementMode = GoogleReplacementMode.WITHOUT_PRORATION)

A composable that provides a "slide to unlock" UI to initiate a purchase for a StoreProduct. When the user slides the component to the end, it triggers the RevenueCat purchase flow.

On the Play Store, this function supports upgrading a subscription by providing oldProductId. The default SubscriptionOption is chosen automatically based on RevenueCat's logic, which prioritizes free trials and introductory offers.

Parameters

storeProduct

The StoreProduct the user intends to purchase.

modifier

The Modifier to be applied to this component.

colors

The SlideToUnlockColors used to customize the appearance.

hintTexts

The HintTexts to display in the component's track.

onSlideCompleted

A callback invoked immediately when the user completes the slide gesture, before the purchase flow begins.

onPurchaseStateChanged

A callback that reports the current PurchaseState of the transaction (Loading, Success, or Error).

isPersonalizedPrice

(Google Play only) An optional boolean indicating personalized pricing. See Google's documentation for details.

oldProductId

(Google Play only) The product ID of a subscription to upgrade from.

replacementMode

(Google Play only) The GoogleReplacementMode to use for the subscription upgrade. This is ignored if oldProductId is null.


fun SlideToPurchases(packageToPurchase: Package, modifier: Modifier = Modifier, colors: SlideToUnlockColors = DefaultSlideToUnlockColors(), hintTexts: HintTexts = HintTexts.defaultHintTexts(), onSlideCompleted: () -> Unit = {}, onPurchaseStateChanged: (PurchaseState) -> Unit = {}, isPersonalizedPrice: Boolean? = null, oldProductId: String? = null, replacementMode: GoogleReplacementMode = GoogleReplacementMode.WITHOUT_PRORATION)

A composable that provides a "slide to unlock" UI to initiate a purchase for a Package. When the user slides the component to the end, it triggers the RevenueCat purchase flow.

On the Play Store, this function supports upgrading a subscription by providing oldProductId. The default SubscriptionOption is chosen automatically from the packageToPurchase.

Parameters

packageToPurchase

The Package the user intends to purchase.

modifier

The Modifier to be applied to this component.

colors

The SlideToUnlockColors used to customize the appearance.

hintTexts

The HintTexts to display in the component's track.

onSlideCompleted

A callback invoked immediately when the user completes the slide gesture, before the purchase flow begins.

onPurchaseStateChanged

A callback that reports the current PurchaseState of the transaction (Loading, Success, or Error).

isPersonalizedPrice

(Google Play only) An optional boolean indicating personalized pricing.

oldProductId

(Google Play only) The product ID of a subscription to upgrade from.

replacementMode

(Google Play only) The GoogleReplacementMode to use for the subscription upgrade.


fun SlideToPurchases(subscriptionOption: SubscriptionOption, modifier: Modifier = Modifier, colors: SlideToUnlockColors = DefaultSlideToUnlockColors(), hintTexts: HintTexts = HintTexts.defaultHintTexts(), onSlideCompleted: () -> Unit = {}, onPurchaseStateChanged: (PurchaseState) -> Unit = {}, isPersonalizedPrice: Boolean? = null, oldProductId: String? = null, replacementMode: GoogleReplacementMode = GoogleReplacementMode.WITHOUT_PRORATION)

A composable that provides a "slide to unlock" UI to initiate a purchase for a specific SubscriptionOption. This is a Google Play-only function.

Parameters

subscriptionOption

The specific SubscriptionOption the user intends to purchase.

modifier

The Modifier to be applied to this component.

colors

The SlideToUnlockColors used to customize the appearance.

hintTexts

The HintTexts to display in the component's track.

onSlideCompleted

A callback invoked immediately when the user completes the slide gesture.

onPurchaseStateChanged

A callback that reports the current PurchaseState of the transaction.

isPersonalizedPrice

An optional boolean indicating personalized pricing.

oldProductId

The product ID of a subscription to upgrade from.

replacementMode

The GoogleReplacementMode to use for the subscription upgrade.


fun SlideToPurchases(storeProduct: StoreProduct, promotionalOffer: PromotionalOffer, modifier: Modifier = Modifier, colors: SlideToUnlockColors = DefaultSlideToUnlockColors(), hintTexts: HintTexts = HintTexts.defaultHintTexts(), onSlideCompleted: () -> Unit = {}, onPurchaseStateChanged: (PurchaseState) -> Unit = {})

A composable that provides a "slide to unlock" UI to initiate a purchase for a StoreProduct with an applied promotional offer. This is an App Store-only function.

Use this function if you are not using RevenueCat's Offerings system. If you are using Offerings, use the overload with a Package parameter instead.

Parameters

storeProduct

The StoreProduct the user intends to purchase.

promotionalOffer

The PromotionalOffer to apply to the purchase.

modifier

The Modifier to be applied to this component.

colors

The SlideToUnlockColors used to customize the appearance.

hintTexts

The HintTexts to display in the component's track.

onSlideCompleted

A callback invoked immediately when the user completes the slide gesture.

onPurchaseStateChanged

A callback that reports the current PurchaseState of the transaction.

See also

awaitPromotionalOffer

fun SlideToPurchases(packageToPurchase: Package, promotionalOffer: PromotionalOffer, modifier: Modifier = Modifier, colors: SlideToUnlockColors = DefaultSlideToUnlockColors(), hintTexts: HintTexts = HintTexts.defaultHintTexts(), onSlideCompleted: () -> Unit = {}, onPurchaseStateChanged: (PurchaseState) -> Unit = {})

A composable that provides a "slide to unlock" UI to initiate a purchase for a Package with an applied promotional offer. This is an App Store-only function.

Only call this in direct response to user input.

Parameters

packageToPurchase

The Package the user intends to purchase.

promotionalOffer

The PromotionalOffer to apply to the purchase.

modifier

The Modifier to be applied to this component.

colors

The SlideToUnlockColors used to customize the appearance.

hintTexts

The HintTexts to display in the component's track.

onSlideCompleted

A callback invoked immediately when the user completes the slide gesture.

onPurchaseStateChanged

A callback that reports the current PurchaseState of the transaction.

See also

awaitPromotionalOffer

fun SlideToPurchases(storeProduct: StoreProduct, winBackOffer: WinBackOffer, modifier: Modifier = Modifier, colors: SlideToUnlockColors = DefaultSlideToUnlockColors(), hintTexts: HintTexts = HintTexts.defaultHintTexts(), onSlideCompleted: () -> Unit = {}, onPurchaseStateChanged: (PurchaseState) -> Unit = {})

A composable that provides a "slide to unlock" UI to initiate a purchase for a StoreProduct with a given win-back offer. This is an iOS-only function and requires iOS 18.0+.

If you are using RevenueCat's Offerings system, use the overload with a Package parameter instead.

Parameters

storeProduct

The StoreProduct to purchase.

winBackOffer

The WinBackOffer to apply to the purchase.

modifier

The Modifier to be applied to this component.

colors

The SlideToUnlockColors used to customize the appearance.

hintTexts

The HintTexts to display in the component's track.

onSlideCompleted

A callback invoked immediately when the user completes the slide gesture.

onPurchaseStateChanged

A callback that reports the current PurchaseState of the transaction.

See also

awaitEligibleWinBackOffersForProduct

fun SlideToPurchases(packageToPurchase: Package, winBackOffer: WinBackOffer, modifier: Modifier = Modifier, colors: SlideToUnlockColors = DefaultSlideToUnlockColors(), hintTexts: HintTexts = HintTexts.defaultHintTexts(), onSlideCompleted: () -> Unit = {}, onPurchaseStateChanged: (PurchaseState) -> Unit = {})

A composable that provides a "slide to unlock" UI to initiate a purchase for a Package with a given win-back offer. This is an iOS-only function and requires iOS 18.0+.

Parameters

packageToPurchase

The Package to purchase.

winBackOffer

The WinBackOffer to apply to the purchase.

modifier

The Modifier to be applied to this component.

colors

The SlideToUnlockColors used to customize the appearance.

hintTexts

The HintTexts to display in the component's track.

onSlideCompleted

A callback invoked immediately when the user completes the slide gesture.

onPurchaseStateChanged

A callback that reports the current PurchaseState of the transaction.

See also

awaitEligibleWinBackOffersForPackage