UNPKG

react-native-nami-sdk

Version:

React Native Module for Nami - Easy subscriptions & in-app purchases, with powerful built-in paywalls and A/B testing.

34 lines (33 loc) 1.77 kB
import { NativeEventEmitter, EmitterSubscription } from 'react-native'; import { NamiPurchaseSuccessAmazon, NamiPurchaseSuccessApple, NamiPurchaseSuccessGooglePlay, NamiSKU } from './types'; export declare enum NamiPaywallManagerEvents { RegisterBuySKU = "RegisterBuySKU", PaywallCloseRequested = "PaywallCloseRequested", PaywallSignInRequested = "PaywallSignInRequested", PaywallRestoreRequested = "PaywallRestoreRequested", PaywallDeeplinkAction = "PaywallDeeplinkAction" } export declare enum ServicesEnum { Amazon = "Amazon", GooglePlay = "GooglePlay" } export interface INamiPaywallManager { paywallEmitter: NativeEventEmitter; buySkuCompleteApple: (purchaseSuccess: NamiPurchaseSuccessApple) => void; buySkuCompleteAmazon: (purchaseSuccess: NamiPurchaseSuccessAmazon) => void; buySkuCompleteGooglePlay: (purchaseSuccess: NamiPurchaseSuccessGooglePlay) => void; buySkuCancel: () => void; registerBuySkuHandler: (callback: (sku: NamiSKU) => void) => EmitterSubscription['remove']; registerCloseHandler: (callback: () => void) => EmitterSubscription['remove']; registerSignInHandler: (callback: () => void) => EmitterSubscription['remove']; registerRestoreHandler: (callback: () => void) => EmitterSubscription['remove']; registerDeeplinkActionHandler: (callback: (url: string) => void) => EmitterSubscription['remove']; dismiss: () => Promise<boolean>; show: () => void; hide: () => void; isHidden: () => Promise<boolean>; isPaywallOpen: () => Promise<boolean>; setProductDetails: (productDetails: string, allowOffers: boolean) => void; setAppSuppliedVideoDetails: (url: string, name?: string) => void; } export declare const NamiPaywallManager: INamiPaywallManager;