#Methods

#init

fun init(key: String, context: Context? = null)

Creates a new Access instance (required to display paywalls) using your app ID.

#createPaywall

fun createPaywall(pageType: String = "page", percent: Int? = 80, viewGroup: ViewGroup? = null): Access

Creates an Access paywall and displays it on top of a view group of your choice, hiding a certain percentage of it.

#returnPaywallView

fun returnPaywallView(pageType: String = "page", context: Context): View?

Creates an Access paywall and returns a View object containing the paywall content after it has been rendered. This allows you to display the paywall anywhere and however you want in your app.

#createBottomSheetPaywall

fun createBottomSheetPaywall(pageType: String = "page", viewGroup: ViewGroup, onDismissBottomSheet: (() -> Unit)? = null): Access

Creates an Access paywall and displays it as a bottom sheet on top of a view group of your choice.

#config

fun config(key: String, value: Any? = null, readOnly: Boolean? = null): Access

fun config(mapConfig: Map<String, Any>, readOnly: Boolean? = null): Access

Configures the Access instance with the provided key-value pairs. See the configuration options documentation.

#texts

fun texts(key: String, value: String, readOnly: Boolean? = null, locale: String? = null): Access

fun texts(mapTexts: Map<String, String>, readOnly: Boolean? = null, locale: String? = null): Access

Sets the texts for the Access instance with the provided key-value pairs. See the texts documentation.

⚠️ Our SDK currently embeds only two languages: English and French (defaults to English).

#styles

fun styles(key: String, value: Any? = null, readOnly: Boolean? = null): Access

fun styles(mapStyles: Map<String, Any>, readOnly: Boolean? = null): Access

Sets the styles for the Access instance with the provided key-value pairs. See the styles documentation.

#variables

fun variables(key: String, value: Any? = null): Access

fun variables(mapVariables: Map<String, Any>): Access

Sets the variables for the Access instance with the provided key-value pairs. See the variables documentation.

#on*

fun on*(event: String, callback: (data: Any?) -> Unit): Access

Allows you to set a callback to be called when a specific event is triggered (ex: onIdentityAvailable). See the events documentation.

#off

fun off(event: PaywallEvents): Access

Allows to remove a callback previously set with on*. Accepted values for event are:
  • PaywallEvents.IDENTITY_AVAILABLE
  • PaywallEvents.LOCK
  • PaywallEvents.READY
  • PaywallEvents.PAYWALL_SEEN
  • PaywallEvents.RELEASE
  • PaywallEvents.REGISTER
  • PaywallEvents.SUBSCRIBE_CLICK
  • PaywallEvents.LOGIN_CLICK
  • PaywallEvents.DISCOVERY_LINK_CLICK
  • PaywallEvents.ALTERNATIVE_CLICK
  • PaywallEvents.ERROR
  • PaywallEvents.DATA_POLICY_CLICK
  • PaywallEvents.FORM_SUBMIT
  • PaywallEvents.ANSWER
  • PaywallEvents.CUSTOM_BUTTON_CLICK
  • PaywallEvents.DESTROY
  • PaywallEvents.DISMISS_BOTTOM_SHEET

#destroy

fun destroy(): Unit

Destroys the Access instance and removes all listeners.