@adapty/capacitor - v3.10.0-beta.1
    Preparing search index...

    Interface EventHandlers

    Paywall event handlers configuration

    interface EventHandlers {
        onAndroidSystemBack: () => EventHandlerResult;
        onCloseButtonPress: () => EventHandlerResult;
        onCustomAction: (actionId: string) => EventHandlerResult;
        onLoadingProductsFailed: (error: AdaptyError) => EventHandlerResult;
        onPaywallClosed: () => EventHandlerResult;
        onPaywallShown: () => EventHandlerResult;
        onProductSelected: (productId: string) => EventHandlerResult;
        onPurchaseCompleted: (
            purchaseResult: AdaptyPurchaseResult,
            product: AdaptyPaywallProduct,
        ) => EventHandlerResult;
        onPurchaseFailed: (
            error: AdaptyError,
            product: AdaptyPaywallProduct,
        ) => EventHandlerResult;
        onPurchaseStarted: (product: AdaptyPaywallProduct) => EventHandlerResult;
        onRenderingFailed: (error: AdaptyError) => EventHandlerResult;
        onRestoreCompleted: (profile: AdaptyProfile) => EventHandlerResult;
        onRestoreFailed: (error: AdaptyError) => EventHandlerResult;
        onRestoreStarted: () => EventHandlerResult;
        onUrlPress: (url: string) => EventHandlerResult;
        onWebPaymentNavigationFinished: (
            product?: AdaptyPaywallProduct,
            error?: AdaptyError,
        ) => EventHandlerResult;
    }
    Index

    Properties

    onAndroidSystemBack: () => 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.

    true
    
    onCloseButtonPress: () => 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.

    true
    
    onCustomAction: (actionId: string) => EventHandlerResult

    Called when a user performs a custom action in the paywall view

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

    false
    
    onLoadingProductsFailed: (error: AdaptyError) => 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.

    Type Declaration

    false
    
    onPaywallClosed: () => EventHandlerResult

    Called when the paywall view disappears

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

    false
    
    onPaywallShown: () => EventHandlerResult

    Called when the paywall view appears

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

    false
    
    onProductSelected: (productId: string) => EventHandlerResult

    Called when a user selects a product in the paywall view

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

    false
    
    onPurchaseCompleted: (
        purchaseResult: AdaptyPurchaseResult,
        product: AdaptyPaywallProduct,
    ) => 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.

    Type Declaration

    purchaseResult.type !== 'user_cancelled'

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

    Called if a purchase fails after a user taps the purchase button

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

    Type Declaration

    false
    
    onPurchaseStarted: (product: AdaptyPaywallProduct) => EventHandlerResult

    Called when a purchase process starts

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

    false
    
    onRenderingFailed: (error: AdaptyError) => 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.

    Type Declaration

    false
    
    onRestoreCompleted: (profile: AdaptyProfile) => 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.

    Type Declaration

    true
    
    onRestoreFailed: (error: AdaptyError) => 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.

    Type Declaration

    false
    
    onRestoreStarted: () => 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.

    false
    
    onUrlPress: (url: string) => EventHandlerResult

    Called when a user taps an URL in the paywall view

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

    false
    
    onWebPaymentNavigationFinished: (
        product?: AdaptyPaywallProduct,
        error?: AdaptyError,
    ) => EventHandlerResult

    Called when web payment navigation finishes

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

    false