getPaywallView

fun getPaywallView(activity: Activity, viewConfiguration: AdaptyUI.ViewConfiguration, products: List<AdaptyPaywallProduct>?, insets: AdaptyPaywallInsets, eventListener: AdaptyUiEventListener, personalizedOfferResolver: AdaptyUiPersonalizedOfferResolver = AdaptyUiPersonalizedOfferResolver.DEFAULT, tagResolver: AdaptyUiTagResolver = AdaptyUiTagResolver.DEFAULT, observerModeHandler: AdaptyUiObserverModeHandler? = null): AdaptyPaywallView

Right after receiving ViewConfiguration, you can create the corresponding AdaptyPaywallView to display it afterwards.

This method should be called only on UI thread.

Return

An AdaptyPaywallView object, representing the requested paywall screen.

Parameters

activity

An Activity instance.

viewConfiguration

An ViewConfiguration object containing information about the visual part of the paywall. To load it, use the AdaptyUI.getViewConfiguration method.

products

Optional AdaptyPaywallProduct list. Pass this value in order to optimize the display time of the products on the screen. If you pass null, AdaptyUI will automatically fetch the required products.

insets

In case the status bar or navigation bar overlap the view, you can pass an AdaptyPaywallInsets object. If the status bar doesn't overlap the AdaptyPaywallView, the top value should be 0. If the navigation bar doesn't overlap the AdaptyPaywallView, the bottom value should be 0. If none of them do, you can pass AdaptyPaywallInsets.NONE.

eventListener

An object that implements the AdaptyUiEventListener interface. Use it to respond to different events happening inside the purchase screen. Also you can extend AdaptyUiDefaultEventListener so you don't need to override all the methods.

personalizedOfferResolver

In case you want to indicate whether the price is personalized (read more), you can implement AdaptyUiPersonalizedOfferResolver and pass your own logic that maps AdaptyPaywallProduct to true, if the price of the product is personalized, otherwise false.

tagResolver

If you are going to use custom tags functionality, pass the resolver function here.

observerModeHandler

If you use Adapty in Observer mode, pass the AdaptyUiObserverModeHandler implementation to handle purchases on your own.