Interface AdaptyUiEventListener

  • All Implemented Interfaces:

    
    public interface AdaptyUiEventListener
    
                        

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

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