Interface EventHandlers

Hashmap of possible events to their callbacks

Hierarchy

  • EventHandlers

Properties

onAndroidSystemBack: (() => EventHandlerResult)

Type declaration

    • (): EventHandlerResult
    • Called when a user navigates back on Android

      If you return true, the paywall view will be closed. We strongly recommend to return true in this case.

      Returns EventHandlerResult

      Default

      true
      
onCloseButtonPress: (() => EventHandlerResult)

Type declaration

    • (): EventHandlerResult
    • Called when a user taps the close button on the paywall view

      If you return true, the paywall view will be closed. We strongly recommend to return true in this case.

      Returns EventHandlerResult

      Default

      true
      
onCustomAction: ((actionId) => EventHandlerResult)

Type declaration

onLoadingProductsFailed: ((error) => EventHandlerResult)

Type declaration

    • (error): EventHandlerResult
    • Called if a product list fails to load on a presented view, for example, if there is no internet connection

      If you return true from this callback, the paywall view will be closed.

      Parameters

      • error: AdaptyError

        AdaptyError object with error code and message

      Returns EventHandlerResult

onProductSelected: ((productId) => EventHandlerResult)

Type declaration

    • (productId): EventHandlerResult
    • Called when a user taps the product in the paywall view

      If you return true from this callback, the paywall view will be closed.

      Parameters

      • productId: string

      Returns EventHandlerResult

onPurchaseCompleted: ((purchaseResult, product) => EventHandlerResult)

Type declaration

    • (purchaseResult, product): EventHandlerResult
    • Called when the purchase succeeds, the user cancels their purchase, or the purchase appears to be pending

      If you return true from this callback, the paywall view will be closed. We strongly recommend returning purchaseResult.type !== 'user_cancelled' in this case.

      Parameters

      Returns EventHandlerResult

      Default

      purchaseResult.type !== 'user_cancelled'

onPurchaseFailed: ((error, product) => EventHandlerResult)

Type declaration

onPurchaseStarted: ((product) => EventHandlerResult)

Type declaration

onRenderingFailed: ((error) => EventHandlerResult)

Type declaration

    • (error): EventHandlerResult
    • Called if a paywall view fails to render. This should not ever happen, but if it does, feel free to report it to us.

      If you return true from this callback, the paywall view will be closed.

      Parameters

      • error: AdaptyError

        AdaptyError object with error code and message

      Returns EventHandlerResult

onRestoreCompleted: ((profile) => EventHandlerResult)

Type declaration

    • (profile): EventHandlerResult
    • Called when a purchase is completed

      If you return true from this callback, the paywall view will be closed. We strongly recommend to return true in this case.

      Parameters

      Returns EventHandlerResult

      Default

      true
      
onRestoreFailed: ((error) => EventHandlerResult)

Type declaration

    • (error): EventHandlerResult
    • Called if a restore fails after a user taps the restore button

      If you return true from this callback, the paywall view will be closed.

      Parameters

      • error: AdaptyError

        AdaptyError object with error code and message

      Returns EventHandlerResult

onRestoreStarted: (() => EventHandlerResult)

Type declaration

    • (): EventHandlerResult
    • Called when a user taps the restore button in the paywall view

      If you return true from this callback, the paywall view will be closed.

      Returns EventHandlerResult

onUrlPress: ((url) => EventHandlerResult)

Type declaration

Generated using TypeDoc