Class AdaptyUiDefaultEventListener
-
- All Implemented Interfaces:
-
com.adapty.ui.listeners.AdaptyUiEventListener
public class AdaptyUiDefaultEventListener implements AdaptyUiEventListener
-
-
Constructor Summary
Constructors Constructor Description AdaptyUiDefaultEventListener()
-
Method Summary
Modifier and Type Method Description UnitonActionPerformed(AdaptyUI.Action action, Context context)This callback is invoked when user interacts with some widgets on the paywall. UnitonAwaitingSubscriptionUpdateParams(AdaptyPaywallProduct product, Context context, AdaptyUiEventListener.SubscriptionUpdateParamsCallback onSubscriptionUpdateParamsReceived)This callback is invoked when user initiates the purchase process, providing the ability to supply an AdaptySubscriptionUpdateParameters object. BooleanonLoadingProductsFailure(AdaptyError error, Context context)This callback is invoked in case of errors during the products loading process. UnitonProductSelected(AdaptyPaywallProduct product, Context context)This callback is invoked when a product was selected for purchase (by user or by system). UnitonPurchaseFailure(AdaptyError error, AdaptyPaywallProduct product, Context context)This callback is invoked when the purchase process fails. UnitonPurchaseStarted(AdaptyPaywallProduct product, Context context)This callback is invoked when user initiates the purchase process. UnitonPurchaseFinished(AdaptyPurchaseResult purchaseResult, AdaptyPaywallProduct product, Context context)This callback is invoked to inform on a canceled, successful, and pending purchase. UnitonRenderingError(AdaptyError error, Context context)This callback is invoked in case of errors during the screen rendering process. UnitonRestoreFailure(AdaptyError error, Context context)This callback is invoked when the restore process fails. UnitonRestoreStarted(Context context)This callback is invoked when user initiates the restore process. UnitonRestoreSuccess(AdaptyProfile profile, Context context)This callback is invoked when a successful restore is made. -
-
Method Detail
-
onActionPerformed
Unit onActionPerformed(AdaptyUI.Action action, Context context)
This callback is invoked when user interacts with some widgets on the paywall.
If the user presses the "Terms" or "Privacy Policy" buttons, action OpenUrl will be invoked. The default implementation shows a chooser with apps that can open the link.
If the user presses the close button, action Close will be invoked. The default implementation is simply imitating pressing the system back button.
Note: this callback is not invoked when user presses the system back button instead of the close icon on the screen.
If a button has a custom action, action Custom will be invoked.
-
onAwaitingSubscriptionUpdateParams
Unit onAwaitingSubscriptionUpdateParams(AdaptyPaywallProduct product, Context context, AdaptyUiEventListener.SubscriptionUpdateParamsCallback onSubscriptionUpdateParamsReceived)
This callback is invoked when user initiates the purchase process, providing the ability to supply an AdaptySubscriptionUpdateParameters object. This is used when you need one subscription to be replaced with another.
- Parameters:
product- An AdaptyPaywallProduct of the purchase.context- A UI Context within which the event occurred.onSubscriptionUpdateParamsReceived- If a new subscription is purchased while another is still active, callonSubscriptionUpdateParamsReceived(...)either with AdaptySubscriptionUpdateParameters instance if the new subscription should replace a currently active subscription or withnullif the active subscription should remain active and the new one should be added separately.
-
onLoadingProductsFailure
Boolean onLoadingProductsFailure(AdaptyError error, Context context)
This callback is invoked in case of errors during the products loading process.
- Parameters:
error- An AdaptyError object representing the error.context- A UI Context within which the event occurred.
-
onProductSelected
Unit onProductSelected(AdaptyPaywallProduct product, Context context)
This callback is invoked when a product was selected for purchase (by user or by system).
- Parameters:
product- An AdaptyPaywallProduct of the purchase.context- A UI Context within which the event occurred.
-
onPurchaseFailure
Unit onPurchaseFailure(AdaptyError error, AdaptyPaywallProduct product, Context context)
This callback is invoked when the purchase process fails.
- Parameters:
error- An AdaptyError object representing the error.product- An AdaptyPaywallProduct of the purchase.context- A UI Context within which the event occurred.
-
onPurchaseStarted
Unit onPurchaseStarted(AdaptyPaywallProduct product, Context context)
This callback is invoked when user initiates the purchase process.
- Parameters:
product- An AdaptyPaywallProduct of the purchase.context- A UI Context within which the event occurred.
-
onPurchaseFinished
Unit onPurchaseFinished(AdaptyPurchaseResult purchaseResult, AdaptyPaywallProduct product, Context context)
This callback is invoked to inform on a canceled, successful, and pending purchase.
The default implementation is simply calling onBackPressed method of the Activity the AdaptyPaywallView is attached to.
- Parameters:
purchaseResult- An AdaptyPurchaseResult object containing details about the purchase.product- An AdaptyPaywallProduct of the purchase.context- A UI Context within which the event occurred.
-
onRenderingError
Unit onRenderingError(AdaptyError error, Context context)
This callback is invoked in case of errors during the screen rendering process.
- Parameters:
error- An AdaptyError object representing the error.context- A UI Context within which the event occurred.
-
onRestoreFailure
Unit onRestoreFailure(AdaptyError error, Context context)
This callback is invoked when the restore process fails.
- Parameters:
error- An AdaptyError object representing the error.context- A UI Context within which the event occurred.
-
onRestoreStarted
Unit onRestoreStarted(Context context)
This callback is invoked when user initiates the restore process.
- Parameters:
context- A UI Context within which the event occurred.
-
onRestoreSuccess
Unit onRestoreSuccess(AdaptyProfile profile, Context context)
This callback is invoked when a successful restore is made.
Check if the AdaptyProfile object contains the desired access level, and if so, you can navigate back from the paywall.
- Parameters:
profile- An AdaptyProfile object containing up to date information about the user.context- A UI Context within which the event occurred.
-
-
-
-