Interface AdaptyUiEventListener

  • All Implemented Interfaces:

    
    public interface AdaptyUiEventListener
    
                        

    Implement this interface to respond to different events happening inside the purchase screen.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit onActionPerformed(AdaptyUI.Action action, Context context) This callback is invoked when user interacts with some widgets on the paywall.
      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.
      abstract Boolean onLoadingProductsFailure(AdaptyError error, Context context) This callback is invoked in case of errors during the products loading process.
      abstract Unit onProductSelected(AdaptyPaywallProduct product, Context context) This callback is invoked when a product was selected for purchase (by user or by system).
      abstract Unit onPurchaseFailure(AdaptyError error, AdaptyPaywallProduct product, Context context) This callback is invoked when the purchase process fails.
      abstract Unit onPurchaseStarted(AdaptyPaywallProduct product, Context context) This callback is invoked when user initiates the purchase process.
      abstract Unit onPurchaseFinished(AdaptyPurchaseResult purchaseResult, AdaptyPaywallProduct product, Context context) This callback is invoked to inform on a canceled, successful, and pending purchase.
      abstract Unit onRenderingError(AdaptyError error, Context context) This callback is invoked in case of errors during the screen rendering process.
      abstract Unit onRestoreFailure(AdaptyError error, Context context) This callback is invoked when the restore process fails.
      abstract Unit onRestoreStarted(Context context) This callback is invoked when user initiates the restore process.
      abstract Unit onRestoreSuccess(AdaptyProfile profile, Context context) This callback is invoked when a successful restore is made.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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.

        Parameters:
        action - An Action object representing the action.
        context - A UI Context within which the event occurred.
      • 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, call onSubscriptionUpdateParamsReceived(...) either with AdaptySubscriptionUpdateParameters instance if the new subscription should replace a currently active subscription or with null if 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.
      • 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.