launchIfNeeded

fun launchIfNeeded(requiredEntitlementIdentifier: String, offering: Offering? = null, fontProvider: ParcelizableFontProvider? = null, shouldDisplayDismissButton: Boolean = DEFAULT_DISPLAY_DISMISS_BUTTON, paywallDisplayCallback: PaywallDisplayCallback? = null)

Launch the paywall activity if the current user does not have requiredEntitlementIdentifier active.

Parameters

offering

The offering to be shown in the paywall. If null, the current offering will be shown.

fontProvider

The ParcelizableFontProvider to be used in the paywall. If null, the default fonts will be used.

requiredEntitlementIdentifier

the paywall will be displayed only if the current user does not have this entitlement active.

shouldDisplayDismissButton

Whether to display the dismiss button in the paywall.

paywallDisplayCallback

Callback that will be called with true if the paywall was displayed


fun launchIfNeeded(requiredEntitlementIdentifier: String, offeringIdentifier: String, fontProvider: ParcelizableFontProvider? = null, shouldDisplayDismissButton: Boolean = DEFAULT_DISPLAY_DISMISS_BUTTON, paywallDisplayCallback: PaywallDisplayCallback? = null)

Do not use this method, use the method with the same name that takes an Offering instead. This method is used internally by the hybrid SDKs.

Launch the paywall activity if the current user does not have requiredEntitlementIdentifier active.

Parameters

offeringIdentifier

The offering identifier of the ofering to be shown in the paywall. If null, the current offering will be shown.

fontProvider

The ParcelizableFontProvider to be used in the paywall. If null, the default fonts will be used.

requiredEntitlementIdentifier

the paywall will be displayed only if the current user does not have this entitlement active.

shouldDisplayDismissButton

Whether to display the dismiss button in the paywall.

paywallDisplayCallback

Callback that will be called with true if the paywall was displayed


fun launchIfNeeded(offering: Offering? = null, fontProvider: ParcelizableFontProvider? = null, shouldDisplayDismissButton: Boolean = DEFAULT_DISPLAY_DISMISS_BUTTON, shouldDisplayBlock: (CustomerInfo) -> Boolean)

Launch the paywall activity based on whether the result of shouldDisplayBlock is true.

Parameters

offering

The offering to be shown in the paywall. If null, the current offering will be shown.

fontProvider

The ParcelizableFontProvider to be used in the paywall. If null, the default fonts will be used.

shouldDisplayDismissButton

Whether to display the dismiss button in the paywall.

shouldDisplayBlock

the paywall will be displayed only if this returns true.