Paywall

@Serializable
data class Paywall(val databaseId: String, var identifier: PaywallIdentifier, val name: String, val url: PaywallURL, val htmlSubstitutions: String, presentationStyle: String?, expandedPresentationStyle: PaywallPresentationStyle?, presentationDelay: Long, presentationCondition: String, var presentation: PaywallPresentationInfo = PaywallPresentationInfo( style = expandedPresentationStyle ?: PaywallPresentationStyle.None.also { Logger.debug( LogLevel.warn, LogScope.paywallPresentation, "Unknown or unsupported presentation style: $presentationStyle", ) }, delay = presentationDelay, ), val backgroundColorHex: String, val darkBackgroundColorHex: String? = null, _products: List<ProductItem> = emptyList(), _productItemsV3: List<CrossplatformProduct> = emptyList(), _productItems: List<ProductItem> = emptyList(), var productIds: List<String> = _productItems.map { it.compositeId }.ifEmpty { _productItemsV3.map { it.fullProductId } }, var responseLoadingInfo: Paywall.LoadingInfo = LoadingInfo(), var webviewLoadingInfo: Paywall.LoadingInfo = LoadingInfo(), var productsLoadingInfo: Paywall.LoadingInfo = LoadingInfo(), var shimmerLoadingInfo: Paywall.LoadingInfo = LoadingInfo(), var productVariables: List<ProductVariable>? = null, var swProductVariablesTemplate: List<ProductVariable>? = null, var paywalljsVersion: String? = null, var isFreeTrialAvailable: Boolean = false, var presentationSourceType: String? = null, var featureGating: FeatureGatingBehavior = FeatureGatingBehavior.NonGated, var computedPropertyRequests: List<ComputedPropertyRequest> = emptyList(), var localNotifications: List<LocalNotification> = emptyList(), var onDeviceCache: OnDeviceCaching = OnDeviceCaching.Disabled, var experiment: Experiment? = null, var closeReason: PaywallCloseReason = PaywallCloseReason.None, var state: Map<String, Any> = emptyMap(), val urlConfig: PaywallWebviewUrl.Config? = null, val cacheKey: CacheKey, val buildId: String, var surveys: List<Survey> = emptyList(), val isScrollEnabled: Boolean? = true, val rerouteBackButton: Paywall.ToggleMode? = null) : SerializableEntity(source)

Constructors

Link copied to clipboard
constructor(databaseId: String, identifier: PaywallIdentifier, name: String, url: PaywallURL, htmlSubstitutions: String, presentationStyle: String?, expandedPresentationStyle: PaywallPresentationStyle?, presentationDelay: Long, presentationCondition: String, presentation: PaywallPresentationInfo = PaywallPresentationInfo( style = expandedPresentationStyle ?: PaywallPresentationStyle.None.also { Logger.debug( LogLevel.warn, LogScope.paywallPresentation, "Unknown or unsupported presentation style: $presentationStyle", ) }, delay = presentationDelay, ), backgroundColorHex: String, darkBackgroundColorHex: String? = null, _products: List<ProductItem> = emptyList(), _productItemsV3: List<CrossplatformProduct> = emptyList(), _productItems: List<ProductItem> = emptyList(), productIds: List<String> = _productItems.map { it.compositeId }.ifEmpty { _productItemsV3.map { it.fullProductId } }, responseLoadingInfo: Paywall.LoadingInfo = LoadingInfo(), webviewLoadingInfo: Paywall.LoadingInfo = LoadingInfo(), productsLoadingInfo: Paywall.LoadingInfo = LoadingInfo(), shimmerLoadingInfo: Paywall.LoadingInfo = LoadingInfo(), productVariables: List<ProductVariable>? = null, swProductVariablesTemplate: List<ProductVariable>? = null, paywalljsVersion: String? = null, isFreeTrialAvailable: Boolean = false, presentationSourceType: String? = null, featureGating: FeatureGatingBehavior = FeatureGatingBehavior.NonGated, computedPropertyRequests: List<ComputedPropertyRequest> = emptyList(), localNotifications: List<LocalNotification> = emptyList(), onDeviceCache: OnDeviceCaching = OnDeviceCaching.Disabled, experiment: Experiment? = null, closeReason: PaywallCloseReason = PaywallCloseReason.None, state: Map<String, Any> = emptyMap(), urlConfig: PaywallWebviewUrl.Config? = null, cacheKey: CacheKey, buildId: String, surveys: List<Survey> = emptyList(), isScrollEnabled: Boolean? = true, rerouteBackButton: Paywall.ToggleMode? = null)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
@Serializable
data class LoadingInfo(var startAt: Date? = null, var endAt: Date? = null, var failAt: Date? = null)
Link copied to clipboard
@Serializable
enum ToggleMode : Enum<Paywall.ToggleMode>

Properties

Link copied to clipboard
Link copied to clipboard
@SerialName(value = "background_color_hex")
val backgroundColorHex: String
Link copied to clipboard
@Serializable
@SerialName(value = "build_id")
val buildId: String
Link copied to clipboard
@Serializable
@SerialName(value = "cache_key")
val cacheKey: CacheKey
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "computed_properties")
var computedPropertyRequests: List<ComputedPropertyRequest>
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "dark_background_color_hex")
val darkBackgroundColorHex: String?
Link copied to clipboard
@SerialName(value = "id")
val databaseId: String
Link copied to clipboard
@Transient
var experiment: Experiment?
Link copied to clipboard
@SerialName(value = "feature_gating")
var featureGating: FeatureGatingBehavior
Link copied to clipboard
@SerialName(value = "paywalljs_event")
val htmlSubstitutions: String
Link copied to clipboard
@SerialName(value = "identifier")
var identifier: PaywallIdentifier
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "is_scroll_enabled")
val isScrollEnabled: Boolean?
Link copied to clipboard
@SerialName(value = "local_notifications")
var localNotifications: List<LocalNotification>
Link copied to clipboard
@SerialName(value = "name")
val name: String
Link copied to clipboard
@SerialName(value = "on_device_cache")
var onDeviceCache: OnDeviceCaching

Indicates whether the caching of the paywall is enabled or not.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Transient
var productIds: List<String>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "reroute_back_button")
val rerouteBackButton: Paywall.ToggleMode?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Transient
var state: Map<String, Any>

The state of the paywall, updated on paywall did dismiss.

Link copied to clipboard
Link copied to clipboard
@SerialName(value = "surveys")
var surveys: List<Survey>

Surveys to potentially show when an action happens in the paywall.

Link copied to clipboard
Link copied to clipboard
@SerialName(value = "url")
val url: PaywallURL
Link copied to clipboard
@SerialName(value = "url_config")
val urlConfig: PaywallWebviewUrl.Config?
Link copied to clipboard

Functions

Link copied to clipboard
fun getInfo(fromEvent: EventData?): PaywallInfo
Link copied to clipboard
fun update(paywall: Paywall)