Interface AdaptyUiEventListener
-
- All Implemented Interfaces:
public interface AdaptyUiEventListenerImplement this interface to respond to different events happening inside the purchase screen.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceAdaptyUiEventListener.SubscriptionUpdateParamsCallback
-
Method Summary
Modifier and Type Method Description abstract UnitonActionPerformed(AdaptyUI.Action action, Context context)This callback is invoked when user interacts with some widgets on the paywall. abstract 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. abstract BooleanonLoadingProductsFailure(AdaptyError error, Context context)This callback is invoked in case of errors during the products loading process. abstract UnitonPaywallClosed()This callback is invoked when the paywall view was dismissed. abstract UnitonPaywallShown(Context context)This callback is invoked when the paywall view was presented. abstract UnitonProductSelected(AdaptyPaywallProduct product, Context context)This callback is invoked when a product was selected for purchase (by user or by system). abstract UnitonPurchaseFailure(AdaptyError error, AdaptyPaywallProduct product, Context context)This callback is invoked when the purchase process fails. abstract UnitonPurchaseStarted(AdaptyPaywallProduct product, Context context)This callback is invoked when user initiates the purchase process. abstract UnitonPurchaseFinished(AdaptyPurchaseResult purchaseResult, AdaptyPaywallProduct product, Context context)This callback is invoked to inform on a canceled, successful, and pending purchase. abstract UnitonRenderingError(AdaptyError error, Context context)This callback is invoked in case of errors during the screen rendering process. abstract UnitonRestoreFailure(AdaptyError error, Context context)This callback is invoked when the restore process fails. abstract UnitonRestoreStarted(Context context)This callback is invoked when user initiates the restore process. abstract UnitonRestoreSuccess(AdaptyProfile profile, Context context)This callback is invoked when a successful restore is made. -
-
Method Detail
-
onActionPerformed
abstract 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
abstract 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
abstract 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.
-
onPaywallClosed
abstract Unit onPaywallClosed()
This callback is invoked when the paywall view was dismissed.
-
onPaywallShown
abstract Unit onPaywallShown(Context context)
This callback is invoked when the paywall view was presented.
- Parameters:
context- A UI Context within which the event occurred.
-
onProductSelected
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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.
-
-
-
-