Class AdaptyUiDefaultEventListener

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

      • AdaptyUiDefaultEventListener

        AdaptyUiDefaultEventListener()
    • 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.

        Parameters:
        action - An Action object representing the action.
        context - A UI Context within which the event occurred.
      • 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, 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

         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

         Unit onPaywallClosed()

        This callback is invoked when the paywall view was dismissed.

      • onPaywallShown

         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

         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.