fun init(key: String, context: Context? = null)#Methods
#init
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): AccessCreates 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): AccessCreates 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): Accessfun config(mapConfig: Map<String, Any>, readOnly: Boolean? = null): AccessConfigures 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): Accessfun texts(mapTexts: Map<String, String>, readOnly: Boolean? = null, locale: String? = null): AccessSets 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): Accessfun styles(mapStyles: Map<String, Any>, readOnly: Boolean? = null): AccessSets the styles for the Access instance with the provided key-value pairs.
See the styles documentation.
#variables
fun variables(key: String, value: Any? = null): Accessfun variables(mapVariables: Map<String, Any>): AccessSets 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): AccessAllows 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): AccessAllows to remove a callback previously set with
on*.
Accepted values for event are:PaywallEvents.IDENTITY_AVAILABLEPaywallEvents.LOCKPaywallEvents.READYPaywallEvents.PAYWALL_SEENPaywallEvents.RELEASEPaywallEvents.REGISTERPaywallEvents.SUBSCRIBE_CLICKPaywallEvents.LOGIN_CLICKPaywallEvents.DISCOVERY_LINK_CLICKPaywallEvents.ALTERNATIVE_CLICKPaywallEvents.ERRORPaywallEvents.DATA_POLICY_CLICKPaywallEvents.FORM_SUBMITPaywallEvents.ANSWERPaywallEvents.CUSTOM_BUTTON_CLICKPaywallEvents.DESTROYPaywallEvents.DISMISS_BOTTOM_SHEET
#destroy
fun destroy(): UnitDestroys the Access instance and removes all listeners.