Visual constructor
Test out the best Paywalls and Welcome Pages of your Android Apps with Appflow.ai Visual Constructor
Test out the best Paywalls and Welcome pages of your Android Apps with Appflow.ai Visual Constructor
Paywall
The SDK provides a shortcut for displaying paid products. After setting the style in Appflow.ai's remote constructor, you can display it by call method:
Appflow.showPaywall(context: Context, listener: PaywallListener)When the user clicks the back button, the paywall will automatically close, you can also actively close the following methods
Appflow.closePaywall() Example
Appflow.showPaywall(context, object : Appflow.PaywallListener {
override fun onPurchaseCompleted(purchase: Purchase) {
Toast.makeText(this@MainActivity, "successful purchase ${purchase.skus}", Toast.LENGTH_SHORT).show()
}
override fun onClose() {}
override fun onFail(msg: String?) {
Toast.makeText(this@MainActivity, "show paywall fail $msg", Toast.LENGTH_LONG).show()
// or
// Appflow.closePaywall()
}
})API Reference
onPurchaseCompleted(purchase: Purchase)
onPurchaseCompleted(purchase: Purchase)
onClose()
This method is called when the user closes the paywall
onFail(msg: String?)
This method will be called when the paywall loading error
WelcomePage
The SDK provides a welcome page that you can add to your application in the following ways
add in layout page
or dynamically add in the code
a、 in layout page,add timeOut property
b、in the code, set by the constructor
When WelcomePage displays success, failure, or timeout, it will tell you through WelcomeViewListener
Example
API Reference
onShow()
Success callback
onFail(t: Throwable)
Callback when fails or time out
Last updated
Was this helpful?