react-native-adapty - v3.15.2
    Preparing search index...

    Interface EventHandlers

    Hashmap of possible events to their callbacks

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

    onPaywallClosed: () => EventHandlerResult
    onPaywallShown: () => EventHandlerResult
    onProductSelected: (productId: string) => 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.

    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

    onPurchaseStarted: (product: AdaptyPaywallProduct) => EventHandlerResult

    Called when a user taps the purchase button in the paywall view

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

    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

    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

    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.

    onUrlPress: (url: string) => EventHandlerResult
    onWebPaymentNavigationFinished: (
        product?: AdaptyPaywallProduct,
        error?: AdaptyError,
    ) => EventHandlerResult