expo-iap 2.9.0 → 2.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/CONTRIBUTING.md +2 -2
  3. package/README.md +3 -3
  4. package/build/ExpoIap.types.d.ts +33 -15
  5. package/build/ExpoIap.types.d.ts.map +1 -1
  6. package/build/ExpoIap.types.js +64 -17
  7. package/build/ExpoIap.types.js.map +1 -1
  8. package/build/index.d.ts +15 -11
  9. package/build/index.d.ts.map +1 -1
  10. package/build/index.js +48 -23
  11. package/build/index.js.map +1 -1
  12. package/build/modules/ios.d.ts +3 -7
  13. package/build/modules/ios.d.ts.map +1 -1
  14. package/build/modules/ios.js +1 -6
  15. package/build/modules/ios.js.map +1 -1
  16. package/build/types/ExpoIapAndroid.types.d.ts +0 -32
  17. package/build/types/ExpoIapAndroid.types.d.ts.map +1 -1
  18. package/build/types/ExpoIapAndroid.types.js +1 -5
  19. package/build/types/ExpoIapAndroid.types.js.map +1 -1
  20. package/build/types/ExpoIapIOS.types.d.ts +3 -27
  21. package/build/types/ExpoIapIOS.types.d.ts.map +1 -1
  22. package/build/types/ExpoIapIOS.types.js.map +1 -1
  23. package/build/useIAP.d.ts +1 -5
  24. package/build/useIAP.d.ts.map +1 -1
  25. package/build/useIAP.js +47 -41
  26. package/build/useIAP.js.map +1 -1
  27. package/build/utils/errorMapping.d.ts.map +1 -1
  28. package/build/utils/errorMapping.js +24 -0
  29. package/build/utils/errorMapping.js.map +1 -1
  30. package/ios/ExpoIap.podspec +1 -1
  31. package/ios/ExpoIapModule.swift +73 -52
  32. package/package.json +1 -1
  33. package/src/ExpoIap.types.ts +84 -37
  34. package/src/index.ts +60 -49
  35. package/src/modules/ios.ts +4 -9
  36. package/src/types/ExpoIapAndroid.types.ts +2 -36
  37. package/src/types/ExpoIapIOS.types.ts +3 -27
  38. package/src/useIAP.ts +53 -48
  39. package/src/utils/errorMapping.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AAC,UAAU,EAAE,CAAC;YACxB,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,gEAAgE,CACjE,CACF,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;YAChC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,sEAAsE,CACvE,CACF,CAAC;QACJ,CAAC;QACD,OAAO,8BAA8B,CAAC;YACpC,GAAG,EAAE,OAAO,CAAC,UAAU;YACvB,WAAW,EAAE,OAAO,CAAC,kBAAkB;SACxC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,yBAAyB,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEF,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC","sourcesContent":["// External dependencies\nimport {NativeModulesProxy} from 'expo-modules-core';\nimport {Platform} from 'react-native';\n\n// Internal modules\nimport ExpoIapModule from './ExpoIapModule';\nimport {\n isProductIOS,\n validateReceiptIOS,\n deepLinkToSubscriptionsIOS,\n} from './modules/ios';\nimport {\n isProductAndroid,\n validateReceiptAndroid,\n deepLinkToSubscriptionsAndroid,\n} from './modules/android';\n\n// Types\nimport {\n Product,\n Purchase,\n PurchaseError,\n ErrorCode,\n PurchaseResult,\n RequestSubscriptionProps,\n RequestPurchaseProps,\n SubscriptionProduct,\n // Bring platform types from the barrel to avoid deep imports\n PurchaseAndroid,\n PaymentDiscount,\n} from './ExpoIap.types';\n\n// Export all types\nexport * from './ExpoIap.types';\nexport * from './modules/android';\nexport * from './modules/ios';\n\n// Export subscription helpers\nexport {\n getActiveSubscriptions,\n hasActiveSubscriptions,\n type ActiveSubscription,\n} from './helpers/subscription';\n\n// Get the native constant value\nexport const PI = ExpoIapModule.PI;\n\nexport enum OpenIapEvent {\n PurchaseUpdated = 'purchase-updated',\n PurchaseError = 'purchase-error',\n /** @deprecated Use PurchaseUpdated instead. This will be removed in a future version. */\n TransactionIapUpdated = 'iap-transaction-updated',\n PromotedProductIOS = 'promoted-product-ios',\n}\n\nexport function setValueAsync(value: string) {\n return ExpoIapModule.setValueAsync(value);\n}\n\n// Ensure the emitter has proper EventEmitter interface\nexport const emitter = (ExpoIapModule || NativeModulesProxy.ExpoIap) as {\n addListener: (\n eventName: string,\n listener: (...args: any[]) => void,\n ) => {remove: () => void};\n removeListener: (\n eventName: string,\n listener: (...args: any[]) => void,\n ) => void;\n};\n\nexport const purchaseUpdatedListener = (\n listener: (event: Purchase) => void,\n) => {\n console.log('[JS] Registering purchaseUpdatedListener');\n const wrappedListener = (event: Purchase) => {\n console.log('[JS] purchaseUpdatedListener fired:', event);\n listener(event);\n };\n const emitterSubscription = emitter.addListener(\n OpenIapEvent.PurchaseUpdated,\n wrappedListener,\n );\n console.log('[JS] purchaseUpdatedListener registered successfully');\n return emitterSubscription;\n};\n\nexport const purchaseErrorListener = (\n listener: (error: PurchaseError) => void,\n) => {\n console.log('[JS] Registering purchaseErrorListener');\n const wrappedListener = (error: PurchaseError) => {\n console.log('[JS] purchaseErrorListener fired:', error);\n listener(error);\n };\n const emitterSubscription = emitter.addListener(\n OpenIapEvent.PurchaseError,\n wrappedListener,\n );\n console.log('[JS] purchaseErrorListener registered successfully');\n return emitterSubscription;\n};\n\n/**\n * iOS-only listener for App Store promoted product events.\n * This fires when a user taps on a promoted product in the App Store.\n *\n * @param listener - Callback function that receives the promoted product details\n * @returns EventSubscription that can be used to unsubscribe\n *\n * @example\n * ```typescript\n * const subscription = promotedProductListenerIOS((product) => {\n * console.log('Promoted product:', product);\n * // Handle the promoted product\n * });\n *\n * // Later, clean up\n * subscription.remove();\n * ```\n *\n * @platform iOS\n */\nexport const promotedProductListenerIOS = (\n listener: (product: Product) => void,\n) => {\n if (Platform.OS !== 'ios') {\n console.warn(\n 'promotedProductListenerIOS: This listener is only available on iOS',\n );\n return {remove: () => {}};\n }\n return emitter.addListener(OpenIapEvent.PromotedProductIOS, listener);\n};\n\nexport function initConnection(): Promise<boolean> {\n const result = ExpoIapModule.initConnection();\n return Promise.resolve(result);\n}\n\nexport const getProducts = async (skus: string[]): Promise<Product[]> => {\n console.warn(\n \"`getProducts` is deprecated. Use `fetchProducts({ skus, type: 'inapp' })` instead. This function will be removed in version 3.0.0.\",\n );\n if (!skus?.length) {\n return Promise.reject(new Error('\"skus\" is required'));\n }\n\n return Platform.select({\n ios: async () => {\n const rawItems = await ExpoIapModule.fetchProducts(skus);\n return rawItems.filter((item: unknown) => {\n if (!isProductIOS(item)) return false;\n return (\n typeof item === 'object' &&\n item !== null &&\n 'id' in item &&\n typeof item.id === 'string' &&\n skus.includes(item.id)\n );\n }) as Product[];\n },\n android: async () => {\n const products = await ExpoIapModule.fetchProducts('inapp', skus);\n return products.filter((product: unknown) =>\n isProductAndroid<Product>(product),\n );\n },\n default: () => Promise.reject(new Error('Unsupported Platform')),\n })();\n};\n\nexport const getSubscriptions = async (\n skus: string[],\n): Promise<SubscriptionProduct[]> => {\n console.warn(\n \"`getSubscriptions` is deprecated. Use `fetchProducts({ skus, type: 'subs' })` instead. This function will be removed in version 3.0.0.\",\n );\n if (!skus?.length) {\n return Promise.reject(new Error('\"skus\" is required'));\n }\n\n return Platform.select({\n ios: async () => {\n const rawItems = await ExpoIapModule.fetchProducts(skus);\n return rawItems.filter((item: unknown) => {\n if (!isProductIOS(item)) return false;\n return (\n typeof item === 'object' &&\n item !== null &&\n 'id' in item &&\n typeof item.id === 'string' &&\n skus.includes(item.id)\n );\n }) as SubscriptionProduct[];\n },\n android: async () => {\n const rawItems = await ExpoIapModule.fetchProducts('subs', skus);\n return rawItems.filter((item: unknown) => {\n if (!isProductAndroid(item)) return false;\n return (\n typeof item === 'object' &&\n item !== null &&\n 'id' in item &&\n typeof item.id === 'string' &&\n skus.includes(item.id)\n );\n }) as SubscriptionProduct[];\n },\n default: () => Promise.reject(new Error('Unsupported Platform')),\n })();\n};\n\nexport async function endConnection(): Promise<boolean> {\n return ExpoIapModule.endConnection();\n}\n\n/**\n * Fetch products with unified API (v2.7.0+)\n *\n * @param params - Product fetch configuration\n * @param params.skus - Array of product SKUs to fetch\n * @param params.type - Type of products: 'inapp' for regular products (default) or 'subs' for subscriptions\n *\n * @example\n * ```typescript\n * // Regular products\n * const products = await fetchProducts({\n * skus: ['product1', 'product2'],\n * type: 'inapp'\n * });\n *\n * // Subscriptions\n * const subscriptions = await fetchProducts({\n * skus: ['sub1', 'sub2'],\n * type: 'subs'\n * });\n * ```\n */\nexport const fetchProducts = async ({\n skus,\n type = 'inapp',\n}: {\n skus: string[];\n type?: 'inapp' | 'subs';\n}): Promise<Product[] | SubscriptionProduct[]> => {\n if (!skus?.length) {\n throw new Error('No SKUs provided');\n }\n\n if (Platform.OS === 'ios') {\n const rawItems = await ExpoIapModule.fetchProducts({skus, type});\n\n const filteredItems = rawItems.filter((item: unknown) => {\n if (!isProductIOS(item)) {\n return false;\n }\n const isValid =\n typeof item === 'object' &&\n item !== null &&\n 'id' in item &&\n typeof item.id === 'string' &&\n skus.includes(item.id);\n return isValid;\n });\n\n return type === 'inapp'\n ? (filteredItems as Product[])\n : (filteredItems as SubscriptionProduct[]);\n }\n\n if (Platform.OS === 'android') {\n const items = await ExpoIapModule.fetchProducts(type, skus);\n const filteredItems = items.filter((item: unknown) => {\n if (!isProductAndroid(item)) return false;\n return (\n typeof item === 'object' &&\n item !== null &&\n 'id' in item &&\n typeof item.id === 'string' &&\n skus.includes(item.id)\n );\n });\n\n return type === 'inapp'\n ? (filteredItems as Product[])\n : (filteredItems as SubscriptionProduct[]);\n }\n\n throw new Error('Unsupported platform');\n};\n\n/**\n * @deprecated Use `fetchProducts` instead. This method will be removed in version 3.0.0.\n *\n * The 'request' prefix should only be used for event-based operations that trigger\n * purchase flows. Since this function simply fetches product information, it has been\n * renamed to `fetchProducts` to follow OpenIAP terminology guidelines.\n *\n * @example\n * ```typescript\n * // Old way (deprecated)\n * const products = await requestProducts({\n * skus: ['com.example.product1'],\n * type: 'inapp'\n * });\n *\n * // New way (recommended)\n * const products = await fetchProducts({\n * skus: ['com.example.product1'],\n * type: 'inapp'\n * });\n * ```\n */\nexport const requestProducts = async ({\n skus,\n type = 'inapp',\n}: {\n skus: string[];\n type?: 'inapp' | 'subs';\n}): Promise<Product[] | SubscriptionProduct[]> => {\n console.warn(\n \"`requestProducts` is deprecated. Use `fetchProducts` instead. The 'request' prefix should only be used for event-based operations. This method will be removed in version 3.0.0.\",\n );\n return fetchProducts({skus, type});\n};\n\n/**\n * @deprecated Use `getPurchaseHistories` instead. This function will be removed in version 3.0.0.\n */\nexport const getPurchaseHistory = ({\n alsoPublishToEventListener = false,\n onlyIncludeActiveItems = false,\n alsoPublishToEventListenerIOS,\n onlyIncludeActiveItemsIOS,\n}: {\n /** @deprecated Use alsoPublishToEventListenerIOS instead */\n alsoPublishToEventListener?: boolean;\n /** @deprecated Use onlyIncludeActiveItemsIOS instead */\n onlyIncludeActiveItems?: boolean;\n alsoPublishToEventListenerIOS?: boolean;\n onlyIncludeActiveItemsIOS?: boolean;\n} = {}): Promise<Purchase[]> => {\n console.warn(\n '`getPurchaseHistory` is deprecated. Use `getPurchaseHistories` instead. This function will be removed in version 3.0.0.',\n );\n return getPurchaseHistories({\n alsoPublishToEventListenerIOS:\n alsoPublishToEventListenerIOS ?? alsoPublishToEventListener,\n onlyIncludeActiveItemsIOS:\n onlyIncludeActiveItemsIOS ?? onlyIncludeActiveItems,\n });\n};\n\n/**\n * @deprecated Use getAvailablePurchases instead. This function is just calling getAvailablePurchases internally on iOS\n * and returns an empty array on Android (Google Play Billing v8 removed purchase history API).\n * Will be removed in v2.9.0\n */\nexport const getPurchaseHistories = ({\n alsoPublishToEventListener = false,\n onlyIncludeActiveItems = false,\n alsoPublishToEventListenerIOS,\n onlyIncludeActiveItemsIOS,\n}: {\n /** @deprecated Use alsoPublishToEventListenerIOS instead */\n alsoPublishToEventListener?: boolean;\n /** @deprecated Use onlyIncludeActiveItemsIOS instead */\n onlyIncludeActiveItems?: boolean;\n alsoPublishToEventListenerIOS?: boolean;\n onlyIncludeActiveItemsIOS?: boolean;\n} = {}): Promise<Purchase[]> =>\n (\n Platform.select({\n ios: async () => {\n return ExpoIapModule.getAvailableItems(\n alsoPublishToEventListenerIOS ?? alsoPublishToEventListener,\n onlyIncludeActiveItemsIOS ?? onlyIncludeActiveItems,\n );\n },\n android: async () => {\n // getPurchaseHistoryByType was removed in Google Play Billing Library v8\n // Android doesn't provide purchase history anymore, only active purchases\n console.warn(\n 'getPurchaseHistories is not supported on Android with Google Play Billing Library v8. Use getAvailablePurchases instead to get active purchases.',\n );\n return [];\n },\n }) || (() => Promise.resolve([]))\n )();\n\nexport const getAvailablePurchases = ({\n alsoPublishToEventListener = false,\n onlyIncludeActiveItems = true,\n alsoPublishToEventListenerIOS,\n onlyIncludeActiveItemsIOS,\n}: {\n /** @deprecated Use alsoPublishToEventListenerIOS instead */\n alsoPublishToEventListener?: boolean;\n /** @deprecated Use onlyIncludeActiveItemsIOS instead */\n onlyIncludeActiveItems?: boolean;\n alsoPublishToEventListenerIOS?: boolean;\n onlyIncludeActiveItemsIOS?: boolean;\n} = {}): Promise<Purchase[]> =>\n (\n Platform.select({\n ios: () =>\n ExpoIapModule.getAvailableItems(\n alsoPublishToEventListenerIOS ?? alsoPublishToEventListener,\n onlyIncludeActiveItemsIOS ?? onlyIncludeActiveItems,\n ),\n android: async () => {\n const products = await ExpoIapModule.getAvailableItemsByType('inapp');\n const subscriptions = await ExpoIapModule.getAvailableItemsByType(\n 'subs',\n );\n return products.concat(subscriptions);\n },\n }) || (() => Promise.resolve([]))\n )();\n\nconst offerToRecordIOS = (\n offer: PaymentDiscount | undefined,\n): Record<keyof PaymentDiscount, string> | undefined => {\n if (!offer) return undefined;\n return {\n identifier: offer.identifier,\n keyIdentifier: offer.keyIdentifier,\n nonce: offer.nonce,\n signature: offer.signature,\n timestamp: offer.timestamp.toString(),\n };\n};\n\n// Define discriminated union with explicit type parameter\ntype PurchaseRequest =\n | {\n request: RequestPurchaseProps;\n type?: 'inapp';\n }\n | {\n request: RequestSubscriptionProps;\n type: 'subs';\n };\n\n/**\n * Helper to normalize request props to platform-specific format\n */\nconst normalizeRequestProps = (\n request: RequestPurchaseProps | RequestSubscriptionProps,\n platform: 'ios' | 'android',\n): any => {\n // Platform-specific format - directly return the appropriate platform data\n return platform === 'ios' ? request.ios : request.android;\n};\n\n/**\n * Request a purchase for products or subscriptions.\n *\n * @param requestObj - Purchase request configuration\n * @param requestObj.request - Platform-specific purchase parameters\n * @param requestObj.type - Type of purchase: 'inapp' for products (default) or 'subs' for subscriptions\n *\n * @example\n * ```typescript\n * // Product purchase\n * await requestPurchase({\n * request: {\n * ios: { sku: productId },\n * android: { skus: [productId] }\n * },\n * type: 'inapp'\n * });\n *\n * // Subscription purchase\n * await requestPurchase({\n * request: {\n * ios: { sku: subscriptionId },\n * android: {\n * skus: [subscriptionId],\n * subscriptionOffers: [{ sku: subscriptionId, offerToken: 'token' }]\n * }\n * },\n * type: 'subs'\n * });\n * ```\n */\nexport const requestPurchase = (\n requestObj: PurchaseRequest,\n): Promise<Purchase | Purchase[] | void> => {\n const {request, type = 'inapp'} = requestObj;\n\n if (Platform.OS === 'ios') {\n const normalizedRequest = normalizeRequestProps(request, 'ios');\n\n if (!normalizedRequest?.sku) {\n throw new Error(\n 'Invalid request for iOS. The `sku` property is required and must be a string.',\n );\n }\n\n const {\n sku,\n andDangerouslyFinishTransactionAutomatically = false,\n appAccountToken,\n quantity,\n withOffer,\n } = normalizedRequest;\n\n return (async () => {\n const offer = offerToRecordIOS(withOffer);\n const purchase = await ExpoIapModule.requestPurchase({\n sku,\n andDangerouslyFinishTransactionAutomatically,\n appAccountToken,\n quantity,\n withOffer: offer,\n });\n\n return type === 'inapp' ? (purchase as Purchase) : (purchase as Purchase);\n })();\n }\n\n if (Platform.OS === 'android') {\n const normalizedRequest = normalizeRequestProps(request, 'android');\n\n if (!normalizedRequest?.skus?.length) {\n throw new Error(\n 'Invalid request for Android. The `skus` property is required and must be a non-empty array.',\n );\n }\n\n if (type === 'inapp') {\n const {\n skus,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n isOfferPersonalized,\n } = normalizedRequest;\n\n return (async () => {\n return ExpoIapModule.requestPurchase({\n type: 'inapp',\n skuArr: skus,\n purchaseToken: undefined,\n replacementMode: -1,\n obfuscatedAccountId: obfuscatedAccountIdAndroid,\n obfuscatedProfileId: obfuscatedProfileIdAndroid,\n offerTokenArr: [],\n isOfferPersonalized: isOfferPersonalized ?? false,\n }) as Promise<Purchase[]>;\n })();\n }\n\n if (type === 'subs') {\n const {\n skus,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n isOfferPersonalized,\n subscriptionOffers = [],\n replacementModeAndroid = -1,\n purchaseTokenAndroid,\n purchaseToken,\n } = normalizedRequest;\n\n return (async () => {\n return ExpoIapModule.requestPurchase({\n type: 'subs',\n skuArr: skus,\n purchaseToken: purchaseTokenAndroid || purchaseToken,\n replacementMode: replacementModeAndroid,\n obfuscatedAccountId: obfuscatedAccountIdAndroid,\n obfuscatedProfileId: obfuscatedProfileIdAndroid,\n offerTokenArr: subscriptionOffers.map((so: any) => so.offerToken),\n isOfferPersonalized: isOfferPersonalized ?? false,\n }) as Promise<Purchase[]>;\n })();\n }\n\n throw new Error(\n \"Invalid request for Android: Expected a valid request object with 'skus' array.\",\n );\n }\n\n return Promise.resolve(); // Fallback for unsupported platforms\n};\n\n/**\n * @deprecated Use `requestPurchase({ request, type: 'subs' })` instead. This method will be removed in version 3.0.0.\n *\n * @example\n * ```typescript\n * // Old way (deprecated)\n * await requestSubscription({\n * sku: subscriptionId,\n * // or for Android\n * skus: [subscriptionId],\n * });\n *\n * // New way (recommended)\n * await requestPurchase({\n * request: {\n * ios: { sku: subscriptionId },\n * android: {\n * skus: [subscriptionId],\n * subscriptionOffers: [{ sku: subscriptionId, offerToken: 'token' }]\n * }\n * },\n * type: 'subs'\n * });\n * ```\n */\nexport const requestSubscription = async (\n request: RequestSubscriptionProps,\n): Promise<Purchase | Purchase[] | null | void> => {\n console.warn(\n \"`requestSubscription` is deprecated and will be removed in version 3.0.0. Use `requestPurchase({ request, type: 'subs' })` instead.\",\n );\n return (await requestPurchase({request, type: 'subs'})) as\n | Purchase\n | Purchase[]\n | null\n | void;\n};\n\nexport const finishTransaction = ({\n purchase,\n isConsumable = false,\n}: {\n purchase: Purchase;\n isConsumable?: boolean;\n}): Promise<PurchaseResult | boolean> => {\n return (\n Platform.select({\n ios: async () => {\n const transactionId = purchase.id;\n if (!transactionId) {\n return Promise.reject(\n new Error('purchase.id required to finish iOS transaction'),\n );\n }\n await ExpoIapModule.finishTransaction(transactionId);\n return Promise.resolve(true);\n },\n android: async () => {\n const androidPurchase = purchase as PurchaseAndroid;\n\n // Use purchaseToken if available, fallback to purchaseTokenAndroid for backward compatibility\n const token =\n androidPurchase.purchaseToken || androidPurchase.purchaseTokenAndroid;\n\n if (!token) {\n return Promise.reject(\n new PurchaseError(\n '[expo-iap]: PurchaseError',\n 'Purchase token is required to finish transaction',\n undefined,\n undefined,\n 'E_DEVELOPER_ERROR' as ErrorCode,\n androidPurchase.productId,\n 'android',\n ),\n );\n }\n\n if (isConsumable) {\n return ExpoIapModule.consumeProductAndroid(token);\n }\n\n return ExpoIapModule.acknowledgePurchaseAndroid(token);\n },\n }) || (() => Promise.reject(new Error('Unsupported Platform')))\n )();\n};\n\n/**\n * Retrieves the current storefront information from iOS App Store\n *\n * @returns Promise resolving to the storefront country code\n * @throws Error if called on non-iOS platform\n *\n * @example\n * ```typescript\n * const storefront = await getStorefrontIOS();\n * console.log(storefront); // 'US'\n * ```\n *\n * @platform iOS\n */\nexport const getStorefrontIOS = (): Promise<string> => {\n if (Platform.OS !== 'ios') {\n console.warn('getStorefrontIOS: This method is only available on iOS');\n return Promise.resolve('');\n }\n return ExpoIapModule.getStorefrontIOS();\n};\n\n/**\n * @deprecated Use `getStorefrontIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const getStorefront = (): Promise<string> => {\n console.warn(\n '`getStorefront` is deprecated. Use `getStorefrontIOS` instead. This function will be removed in version 3.0.0.',\n );\n return getStorefrontIOS();\n};\n\n/**\n * Internal receipt validation function (NOT RECOMMENDED for production use)\n *\n * WARNING: This function performs client-side validation which is NOT secure.\n * For production apps, always validate receipts on your secure server:\n * - iOS: Send receipt data to Apple's verification endpoint from your server\n * - Android: Use Google Play Developer API with service account credentials\n */\nexport const validateReceipt = async (\n sku: string,\n androidOptions?: {\n packageName: string;\n productToken: string;\n accessToken: string;\n isSub?: boolean;\n },\n): Promise<any> => {\n if (Platform.OS === 'ios') {\n return await validateReceiptIOS(sku);\n } else if (Platform.OS === 'android') {\n if (\n !androidOptions ||\n !androidOptions.packageName ||\n !androidOptions.productToken ||\n !androidOptions.accessToken\n ) {\n throw new Error(\n 'Android validation requires packageName, productToken, and accessToken',\n );\n }\n return await validateReceiptAndroid({\n packageName: androidOptions.packageName,\n productId: sku,\n productToken: androidOptions.productToken,\n accessToken: androidOptions.accessToken,\n isSub: androidOptions.isSub,\n });\n } else {\n throw new Error('Platform not supported');\n }\n};\n\n/**\n * Deeplinks to native interface that allows users to manage their subscriptions\n * @param options.skuAndroid - Required for Android to locate specific subscription (ignored on iOS)\n * @param options.packageNameAndroid - Required for Android to identify your app (ignored on iOS)\n *\n * @returns Promise that resolves when the deep link is successfully opened\n *\n * @throws {Error} When called on unsupported platform or when required Android parameters are missing\n *\n * @example\n * import { deepLinkToSubscriptions } from 'expo-iap';\n *\n * // Works on both iOS and Android\n * await deepLinkToSubscriptions({\n * skuAndroid: 'your_subscription_sku',\n * packageNameAndroid: 'com.example.app'\n * });\n */\nexport const deepLinkToSubscriptions = (options: {\n skuAndroid?: string;\n packageNameAndroid?: string;\n}): Promise<void> => {\n if (Platform.OS === 'ios') {\n return deepLinkToSubscriptionsIOS();\n }\n\n if (Platform.OS === 'android') {\n if (!options.skuAndroid) {\n return Promise.reject(\n new Error(\n 'skuAndroid is required to locate subscription in Android Store',\n ),\n );\n }\n if (!options.packageNameAndroid) {\n return Promise.reject(\n new Error(\n 'packageNameAndroid is required to identify your app in Android Store',\n ),\n );\n }\n return deepLinkToSubscriptionsAndroid({\n sku: options.skuAndroid,\n packageName: options.packageNameAndroid,\n });\n }\n\n return Promise.reject(new Error(`Unsupported platform: ${Platform.OS}`));\n};\n\nexport * from './useIAP';\nexport * from './utils/errorMapping';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAEtC,mBAAmB;AACnB,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,0BAA0B,EAC1B,OAAO,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC;AAE3B,QAAQ;AACR,OAAO,EAGL,aAAa,EACb,SAAS,GAQV,MAAM,iBAAiB,CAAC;AAEzB,mBAAmB;AACnB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAE9B,8BAA8B;AAC9B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC;AAEhC,gCAAgC;AAChC,MAAM,CAAC,MAAM,EAAE,GAAG,aAAa,CAAC,EAAE,CAAC;AAEnC,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,oDAAoC,CAAA;IACpC,gDAAgC,CAAA;IAChC,yFAAyF;IACzF,iEAAiD,CAAA;IACjD,2DAA2C,CAAA;AAC7C,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB;AAED,MAAM,U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AAK,EAAE,cAAc,CAAC,KAAK;SAC5B,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAGvC,EAAiB,EAAE;IAClB,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QAC1B,OAAO,0BAA0B,EAAE,CAAC;IACtC,CAAC;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC9B,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACxB,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,gEAAgE,CACjE,CACF,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;YAChC,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CACP,sEAAsE,CACvE,CACF,CAAC;QACJ,CAAC;QACD,OAAO,8BAA8B,CAAC;YACpC,GAAG,EAAE,OAAO,CAAC,UAAU;YACvB,WAAW,EAAE,OAAO,CAAC,kBAAkB;SACxC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,yBAAyB,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEF,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC","sourcesContent":["// External dependencies\nimport {NativeModulesProxy} from 'expo-modules-core';\nimport {Platform} from 'react-native';\n\n// Internal modules\nimport ExpoIapModule from './ExpoIapModule';\nimport {\n isProductIOS,\n validateReceiptIOS,\n deepLinkToSubscriptionsIOS,\n syncIOS,\n} from './modules/ios';\nimport {\n isProductAndroid,\n validateReceiptAndroid,\n deepLinkToSubscriptionsAndroid,\n} from './modules/android';\n\n// Types\nimport {\n Product,\n Purchase,\n PurchaseError,\n ErrorCode,\n PurchaseResult,\n RequestSubscriptionProps,\n RequestPurchaseProps,\n SubscriptionProduct,\n // Bring platform types from the barrel to avoid deep imports\n PurchaseAndroid,\n PaymentDiscount,\n} from './ExpoIap.types';\n\n// Export all types\nexport * from './ExpoIap.types';\nexport * from './modules/android';\nexport * from './modules/ios';\n\n// Export subscription helpers\nexport {\n getActiveSubscriptions,\n hasActiveSubscriptions,\n type ActiveSubscription,\n} from './helpers/subscription';\n\n// Get the native constant value\nexport const PI = ExpoIapModule.PI;\n\nexport enum OpenIapEvent {\n PurchaseUpdated = 'purchase-updated',\n PurchaseError = 'purchase-error',\n /** @deprecated Use PurchaseUpdated instead. This will be removed in a future version. */\n TransactionIapUpdated = 'iap-transaction-updated',\n PromotedProductIOS = 'promoted-product-ios',\n}\n\nexport function setValueAsync(value: string) {\n return ExpoIapModule.setValueAsync(value);\n}\n\n// Ensure the emitter has proper EventEmitter interface\nexport const emitter = (ExpoIapModule || NativeModulesProxy.ExpoIap) as {\n addListener: (\n eventName: string,\n listener: (...args: any[]) => void,\n ) => {remove: () => void};\n removeListener: (\n eventName: string,\n listener: (...args: any[]) => void,\n ) => void;\n};\n\nexport const purchaseUpdatedListener = (\n listener: (event: Purchase) => void,\n) => {\n console.log('[JS] Registering purchaseUpdatedListener');\n const wrappedListener = (event: Purchase) => {\n console.log('[JS] purchaseUpdatedListener fired:', event);\n listener(event);\n };\n const emitterSubscription = emitter.addListener(\n OpenIapEvent.PurchaseUpdated,\n wrappedListener,\n );\n console.log('[JS] purchaseUpdatedListener registered successfully');\n return emitterSubscription;\n};\n\nexport const purchaseErrorListener = (\n listener: (error: PurchaseError) => void,\n) => {\n console.log('[JS] Registering purchaseErrorListener');\n const wrappedListener = (error: PurchaseError) => {\n console.log('[JS] purchaseErrorListener fired:', error);\n listener(error);\n };\n const emitterSubscription = emitter.addListener(\n OpenIapEvent.PurchaseError,\n wrappedListener,\n );\n console.log('[JS] purchaseErrorListener registered successfully');\n return emitterSubscription;\n};\n\n/**\n * iOS-only listener for App Store promoted product events.\n * This fires when a user taps on a promoted product in the App Store.\n *\n * @param listener - Callback function that receives the promoted product details\n * @returns EventSubscription that can be used to unsubscribe\n *\n * @example\n * ```typescript\n * const subscription = promotedProductListenerIOS((product) => {\n * console.log('Promoted product:', product);\n * // Handle the promoted product\n * });\n *\n * // Later, clean up\n * subscription.remove();\n * ```\n *\n * @platform iOS\n */\nexport const promotedProductListenerIOS = (\n listener: (product: Product) => void,\n) => {\n if (Platform.OS !== 'ios') {\n console.warn(\n 'promotedProductListenerIOS: This listener is only available on iOS',\n );\n return {remove: () => {}};\n }\n return emitter.addListener(OpenIapEvent.PromotedProductIOS, listener);\n};\n\nexport function initConnection(): Promise<boolean> {\n const result = ExpoIapModule.initConnection();\n return Promise.resolve(result);\n}\n\nexport const getProducts = async (skus: string[]): Promise<Product[]> => {\n console.warn(\n \"`getProducts` is deprecated. Use `fetchProducts({ skus, type: 'inapp' })` instead. This function will be removed in version 3.0.0.\",\n );\n if (!skus?.length) {\n return Promise.reject(\n new PurchaseError({\n message: 'No SKUs provided',\n code: ErrorCode.E_EMPTY_SKU_LIST,\n }),\n );\n }\n\n return Platform.select({\n ios: async () => {\n const rawItems = await ExpoIapModule.fetchProducts(skus);\n return rawItems.filter((item: unknown) => {\n if (!isProductIOS(item)) return false;\n return (\n typeof item === 'object' &&\n item !== null &&\n 'id' in item &&\n typeof item.id === 'string' &&\n skus.includes(item.id)\n );\n }) as Product[];\n },\n android: async () => {\n const products = await ExpoIapModule.fetchProducts('inapp', skus);\n return products.filter((product: unknown) =>\n isProductAndroid<Product>(product),\n );\n },\n default: () => Promise.reject(new Error('Unsupported Platform')),\n })();\n};\n\nexport const getSubscriptions = async (\n skus: string[],\n): Promise<SubscriptionProduct[]> => {\n console.warn(\n \"`getSubscriptions` is deprecated. Use `fetchProducts({ skus, type: 'subs' })` instead. This function will be removed in version 3.0.0.\",\n );\n if (!skus?.length) {\n return Promise.reject(\n new PurchaseError({\n message: 'No SKUs provided',\n code: ErrorCode.E_EMPTY_SKU_LIST,\n }),\n );\n }\n\n return Platform.select({\n ios: async () => {\n const rawItems = await ExpoIapModule.fetchProducts(skus);\n return rawItems.filter((item: unknown) => {\n if (!isProductIOS(item)) return false;\n return (\n typeof item === 'object' &&\n item !== null &&\n 'id' in item &&\n typeof item.id === 'string' &&\n skus.includes(item.id)\n );\n }) as SubscriptionProduct[];\n },\n android: async () => {\n const rawItems = await ExpoIapModule.fetchProducts('subs', skus);\n return rawItems.filter((item: unknown) => {\n if (!isProductAndroid(item)) return false;\n return (\n typeof item === 'object' &&\n item !== null &&\n 'id' in item &&\n typeof item.id === 'string' &&\n skus.includes(item.id)\n );\n }) as SubscriptionProduct[];\n },\n default: () => Promise.reject(new Error('Unsupported Platform')),\n })();\n};\n\nexport async function endConnection(): Promise<boolean> {\n return ExpoIapModule.endConnection();\n}\n\n/**\n * Fetch products with unified API (v2.7.0+)\n *\n * @param params - Product fetch configuration\n * @param params.skus - Array of product SKUs to fetch\n * @param params.type - Type of products: 'inapp' for regular products (default) or 'subs' for subscriptions\n *\n * @example\n * ```typescript\n * // Regular products\n * const products = await fetchProducts({\n * skus: ['product1', 'product2'],\n * type: 'inapp'\n * });\n *\n * // Subscriptions\n * const subscriptions = await fetchProducts({\n * skus: ['sub1', 'sub2'],\n * type: 'subs'\n * });\n * ```\n */\nexport const fetchProducts = async ({\n skus,\n type = 'inapp',\n}: {\n skus: string[];\n type?: 'inapp' | 'subs';\n}): Promise<Product[] | SubscriptionProduct[]> => {\n if (!skus?.length) {\n throw new PurchaseError({\n message: 'No SKUs provided',\n code: ErrorCode.E_EMPTY_SKU_LIST,\n });\n }\n\n if (Platform.OS === 'ios') {\n const rawItems = await ExpoIapModule.fetchProducts({skus, type});\n\n const filteredItems = rawItems.filter((item: unknown) => {\n if (!isProductIOS(item)) {\n return false;\n }\n const isValid =\n typeof item === 'object' &&\n item !== null &&\n 'id' in item &&\n typeof item.id === 'string' &&\n skus.includes(item.id);\n return isValid;\n });\n\n return type === 'inapp'\n ? (filteredItems as Product[])\n : (filteredItems as SubscriptionProduct[]);\n }\n\n if (Platform.OS === 'android') {\n const items = await ExpoIapModule.fetchProducts(type, skus);\n const filteredItems = items.filter((item: unknown) => {\n if (!isProductAndroid(item)) return false;\n return (\n typeof item === 'object' &&\n item !== null &&\n 'id' in item &&\n typeof item.id === 'string' &&\n skus.includes(item.id)\n );\n });\n\n return type === 'inapp'\n ? (filteredItems as Product[])\n : (filteredItems as SubscriptionProduct[]);\n }\n\n throw new Error('Unsupported platform');\n};\n\n/**\n * @deprecated Use `fetchProducts` instead. This method will be removed in version 3.0.0.\n *\n * The 'request' prefix should only be used for event-based operations that trigger\n * purchase flows. Since this function simply fetches product information, it has been\n * renamed to `fetchProducts` to follow OpenIAP terminology guidelines.\n *\n * @example\n * ```typescript\n * // Old way (deprecated)\n * const products = await requestProducts({\n * skus: ['com.example.product1'],\n * type: 'inapp'\n * });\n *\n * // New way (recommended)\n * const products = await fetchProducts({\n * skus: ['com.example.product1'],\n * type: 'inapp'\n * });\n * ```\n */\nexport const requestProducts = async ({\n skus,\n type = 'inapp',\n}: {\n skus: string[];\n type?: 'inapp' | 'subs';\n}): Promise<Product[] | SubscriptionProduct[]> => {\n console.warn(\n \"`requestProducts` is deprecated. Use `fetchProducts` instead. The 'request' prefix should only be used for event-based operations. This method will be removed in version 3.0.0.\",\n );\n return fetchProducts({skus, type});\n};\n\n/**\n * @deprecated Use `getPurchaseHistories` instead. This function will be removed in version 3.0.0.\n */\nexport const getPurchaseHistory = ({\n alsoPublishToEventListener = false,\n onlyIncludeActiveItems = false,\n alsoPublishToEventListenerIOS,\n onlyIncludeActiveItemsIOS,\n}: {\n /** @deprecated Use alsoPublishToEventListenerIOS instead */\n alsoPublishToEventListener?: boolean;\n /** @deprecated Use onlyIncludeActiveItemsIOS instead */\n onlyIncludeActiveItems?: boolean;\n alsoPublishToEventListenerIOS?: boolean;\n onlyIncludeActiveItemsIOS?: boolean;\n} = {}): Promise<Purchase[]> => {\n console.warn(\n '`getPurchaseHistory` is deprecated. Use `getPurchaseHistories` instead. This function will be removed in version 3.0.0.',\n );\n // Use available purchases as a best-effort replacement\n return getAvailablePurchases({\n alsoPublishToEventListenerIOS:\n alsoPublishToEventListenerIOS ?? alsoPublishToEventListener,\n onlyIncludeActiveItemsIOS:\n onlyIncludeActiveItemsIOS ?? onlyIncludeActiveItems,\n });\n};\n\n// NOTE: `getPurchaseHistories` removed in v2.9.0. Use `getAvailablePurchases` instead.\n\nexport const getAvailablePurchases = ({\n alsoPublishToEventListener = false,\n onlyIncludeActiveItems = true,\n alsoPublishToEventListenerIOS,\n onlyIncludeActiveItemsIOS,\n}: {\n /** @deprecated Use alsoPublishToEventListenerIOS instead */\n alsoPublishToEventListener?: boolean;\n /** @deprecated Use onlyIncludeActiveItemsIOS instead */\n onlyIncludeActiveItems?: boolean;\n alsoPublishToEventListenerIOS?: boolean;\n onlyIncludeActiveItemsIOS?: boolean;\n} = {}): Promise<Purchase[]> =>\n (\n Platform.select({\n ios: () =>\n ExpoIapModule.getAvailableItems(\n alsoPublishToEventListenerIOS ?? alsoPublishToEventListener,\n onlyIncludeActiveItemsIOS ?? onlyIncludeActiveItems,\n ),\n android: async () => {\n const products = await ExpoIapModule.getAvailableItemsByType('inapp');\n const subscriptions = await ExpoIapModule.getAvailableItemsByType(\n 'subs',\n );\n return products.concat(subscriptions);\n },\n }) || (() => Promise.resolve([]))\n )();\n\n/**\n * Restore completed transactions (cross-platform behavior)\n *\n * - iOS: perform a lightweight sync to refresh transactions and ignore sync errors,\n * then fetch available purchases to surface restored items to the app.\n * - Android: simply fetch available purchases (restoration happens via query).\n *\n * This helper returns the restored/available purchases so callers can update UI/state.\n *\n * @param options.alsoPublishToEventListenerIOS - iOS only: whether to also publish to the event listener\n * @param options.onlyIncludeActiveItemsIOS - iOS only: whether to only include active items\n * @returns Promise resolving to the list of available/restored purchases\n */\nexport const restorePurchases = async (\n options: {\n alsoPublishToEventListenerIOS?: boolean;\n onlyIncludeActiveItemsIOS?: boolean;\n } = {},\n): Promise<Purchase[]> => {\n if (Platform.OS === 'ios') {\n // Perform best-effort sync on iOS and ignore sync errors to avoid blocking restore flow\n await syncIOS().catch(() => undefined);\n }\n\n // Then, fetch available purchases for both platforms\n const purchases = await getAvailablePurchases({\n alsoPublishToEventListenerIOS:\n options.alsoPublishToEventListenerIOS ?? false,\n onlyIncludeActiveItemsIOS: options.onlyIncludeActiveItemsIOS ?? true,\n });\n\n return purchases;\n};\n\nconst offerToRecordIOS = (\n offer: PaymentDiscount | undefined,\n): Record<keyof PaymentDiscount, string> | undefined => {\n if (!offer) return undefined;\n return {\n identifier: offer.identifier,\n keyIdentifier: offer.keyIdentifier,\n nonce: offer.nonce,\n signature: offer.signature,\n timestamp: offer.timestamp.toString(),\n };\n};\n\n// Define discriminated union with explicit type parameter\ntype PurchaseRequest =\n | {\n request: RequestPurchaseProps;\n type?: 'inapp';\n }\n | {\n request: RequestSubscriptionProps;\n type: 'subs';\n };\n\n/**\n * Helper to normalize request props to platform-specific format\n */\nconst normalizeRequestProps = (\n request: RequestPurchaseProps | RequestSubscriptionProps,\n platform: 'ios' | 'android',\n): any => {\n // Platform-specific format - directly return the appropriate platform data\n return platform === 'ios' ? request.ios : request.android;\n};\n\n/**\n * Request a purchase for products or subscriptions.\n *\n * @param requestObj - Purchase request configuration\n * @param requestObj.request - Platform-specific purchase parameters\n * @param requestObj.type - Type of purchase: 'inapp' for products (default) or 'subs' for subscriptions\n *\n * @example\n * ```typescript\n * // Product purchase\n * await requestPurchase({\n * request: {\n * ios: { sku: productId },\n * android: { skus: [productId] }\n * },\n * type: 'inapp'\n * });\n *\n * // Subscription purchase\n * await requestPurchase({\n * request: {\n * ios: { sku: subscriptionId },\n * android: {\n * skus: [subscriptionId],\n * subscriptionOffers: [{ sku: subscriptionId, offerToken: 'token' }]\n * }\n * },\n * type: 'subs'\n * });\n * ```\n */\nexport const requestPurchase = (\n requestObj: PurchaseRequest,\n): Promise<Purchase | Purchase[] | void> => {\n const {request, type = 'inapp'} = requestObj;\n\n if (Platform.OS === 'ios') {\n const normalizedRequest = normalizeRequestProps(request, 'ios');\n\n if (!normalizedRequest?.sku) {\n throw new Error(\n 'Invalid request for iOS. The `sku` property is required and must be a string.',\n );\n }\n\n const {\n sku,\n andDangerouslyFinishTransactionAutomatically = false,\n appAccountToken,\n quantity,\n withOffer,\n } = normalizedRequest;\n\n return (async () => {\n const offer = offerToRecordIOS(withOffer);\n const purchase = await ExpoIapModule.requestPurchase({\n sku,\n andDangerouslyFinishTransactionAutomatically,\n appAccountToken,\n quantity,\n withOffer: offer,\n });\n\n return type === 'inapp' ? (purchase as Purchase) : (purchase as Purchase);\n })();\n }\n\n if (Platform.OS === 'android') {\n const normalizedRequest = normalizeRequestProps(request, 'android');\n\n if (!normalizedRequest?.skus?.length) {\n throw new Error(\n 'Invalid request for Android. The `skus` property is required and must be a non-empty array.',\n );\n }\n\n if (type === 'inapp') {\n const {\n skus,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n isOfferPersonalized,\n } = normalizedRequest;\n\n return (async () => {\n return ExpoIapModule.requestPurchase({\n type: 'inapp',\n skuArr: skus,\n purchaseToken: undefined,\n replacementMode: -1,\n obfuscatedAccountId: obfuscatedAccountIdAndroid,\n obfuscatedProfileId: obfuscatedProfileIdAndroid,\n offerTokenArr: [],\n isOfferPersonalized: isOfferPersonalized ?? false,\n }) as Promise<Purchase[]>;\n })();\n }\n\n if (type === 'subs') {\n const {\n skus,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n isOfferPersonalized,\n subscriptionOffers = [],\n replacementModeAndroid = -1,\n purchaseTokenAndroid,\n purchaseToken,\n } = normalizedRequest;\n\n return (async () => {\n return ExpoIapModule.requestPurchase({\n type: 'subs',\n skuArr: skus,\n purchaseToken: purchaseTokenAndroid || purchaseToken,\n replacementMode: replacementModeAndroid,\n obfuscatedAccountId: obfuscatedAccountIdAndroid,\n obfuscatedProfileId: obfuscatedProfileIdAndroid,\n offerTokenArr: subscriptionOffers.map((so: any) => so.offerToken),\n isOfferPersonalized: isOfferPersonalized ?? false,\n }) as Promise<Purchase[]>;\n })();\n }\n\n throw new Error(\n \"Invalid request for Android: Expected a valid request object with 'skus' array.\",\n );\n }\n\n return Promise.resolve(); // Fallback for unsupported platforms\n};\n\n/**\n * @deprecated Use `requestPurchase({ request, type: 'subs' })` instead. This method will be removed in version 3.0.0.\n *\n * @example\n * ```typescript\n * // Old way (deprecated)\n * await requestSubscription({\n * sku: subscriptionId,\n * // or for Android\n * skus: [subscriptionId],\n * });\n *\n * // New way (recommended)\n * await requestPurchase({\n * request: {\n * ios: { sku: subscriptionId },\n * android: {\n * skus: [subscriptionId],\n * subscriptionOffers: [{ sku: subscriptionId, offerToken: 'token' }]\n * }\n * },\n * type: 'subs'\n * });\n * ```\n */\nexport const requestSubscription = async (\n request: RequestSubscriptionProps,\n): Promise<Purchase | Purchase[] | null | void> => {\n console.warn(\n \"`requestSubscription` is deprecated and will be removed in version 3.0.0. Use `requestPurchase({ request, type: 'subs' })` instead.\",\n );\n return (await requestPurchase({request, type: 'subs'})) as\n | Purchase\n | Purchase[]\n | null\n | void;\n};\n\nexport const finishTransaction = ({\n purchase,\n isConsumable = false,\n}: {\n purchase: Purchase;\n isConsumable?: boolean;\n}): Promise<PurchaseResult | boolean> => {\n return (\n Platform.select({\n ios: async () => {\n const transactionId = purchase.id;\n if (!transactionId) {\n return Promise.reject(\n new Error('purchase.id required to finish iOS transaction'),\n );\n }\n await ExpoIapModule.finishTransaction(transactionId);\n return Promise.resolve(true);\n },\n android: async () => {\n const androidPurchase = purchase as PurchaseAndroid;\n\n // Use purchaseToken if available, fallback to purchaseTokenAndroid for backward compatibility\n const token =\n androidPurchase.purchaseToken || androidPurchase.purchaseTokenAndroid;\n\n if (!token) {\n return Promise.reject(\n new PurchaseError({\n message: 'Purchase token is required to finish transaction',\n code: 'E_DEVELOPER_ERROR' as ErrorCode,\n productId: androidPurchase.productId,\n platform: 'android',\n }),\n );\n }\n\n if (isConsumable) {\n return ExpoIapModule.consumeProductAndroid(token);\n }\n\n return ExpoIapModule.acknowledgePurchaseAndroid(token);\n },\n }) || (() => Promise.reject(new Error('Unsupported Platform')))\n )();\n};\n\n/**\n * Retrieves the current storefront information from iOS App Store\n *\n * @returns Promise resolving to the storefront country code\n * @throws Error if called on non-iOS platform\n *\n * @example\n * ```typescript\n * const storefront = await getStorefrontIOS();\n * console.log(storefront); // 'US'\n * ```\n *\n * @platform iOS\n */\nexport const getStorefrontIOS = (): Promise<string> => {\n if (Platform.OS !== 'ios') {\n console.warn('getStorefrontIOS: This method is only available on iOS');\n return Promise.resolve('');\n }\n return ExpoIapModule.getStorefrontIOS();\n};\n\n/**\n * @deprecated Use `getStorefrontIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const getStorefront = (): Promise<string> => {\n console.warn(\n '`getStorefront` is deprecated. Use `getStorefrontIOS` instead. This function will be removed in version 3.0.0.',\n );\n return getStorefrontIOS();\n};\n\n/**\n * Internal receipt validation function (NOT RECOMMENDED for production use)\n *\n * WARNING: This function performs client-side validation which is NOT secure.\n * For production apps, always validate receipts on your secure server:\n * - iOS: Send receipt data to Apple's verification endpoint from your server\n * - Android: Use Google Play Developer API with service account credentials\n */\nexport const validateReceipt = async (\n sku: string,\n androidOptions?: {\n packageName: string;\n productToken: string;\n accessToken: string;\n isSub?: boolean;\n },\n): Promise<any> => {\n if (Platform.OS === 'ios') {\n return await validateReceiptIOS(sku);\n } else if (Platform.OS === 'android') {\n if (\n !androidOptions ||\n !androidOptions.packageName ||\n !androidOptions.productToken ||\n !androidOptions.accessToken\n ) {\n throw new Error(\n 'Android validation requires packageName, productToken, and accessToken',\n );\n }\n return await validateReceiptAndroid({\n packageName: androidOptions.packageName,\n productId: sku,\n productToken: androidOptions.productToken,\n accessToken: androidOptions.accessToken,\n isSub: androidOptions.isSub,\n });\n } else {\n throw new Error('Platform not supported');\n }\n};\n\n/**\n * Deeplinks to native interface that allows users to manage their subscriptions\n * @param options.skuAndroid - Required for Android to locate specific subscription (ignored on iOS)\n * @param options.packageNameAndroid - Required for Android to identify your app (ignored on iOS)\n *\n * @returns Promise that resolves when the deep link is successfully opened\n *\n * @throws {Error} When called on unsupported platform or when required Android parameters are missing\n *\n * @example\n * import { deepLinkToSubscriptions } from 'expo-iap';\n *\n * // Works on both iOS and Android\n * await deepLinkToSubscriptions({\n * skuAndroid: 'your_subscription_sku',\n * packageNameAndroid: 'com.example.app'\n * });\n */\nexport const deepLinkToSubscriptions = (options: {\n skuAndroid?: string;\n packageNameAndroid?: string;\n}): Promise<void> => {\n if (Platform.OS === 'ios') {\n return deepLinkToSubscriptionsIOS();\n }\n\n if (Platform.OS === 'android') {\n if (!options.skuAndroid) {\n return Promise.reject(\n new Error(\n 'skuAndroid is required to locate subscription in Android Store',\n ),\n );\n }\n if (!options.packageNameAndroid) {\n return Promise.reject(\n new Error(\n 'packageNameAndroid is required to identify your app in Android Store',\n ),\n );\n }\n return deepLinkToSubscriptionsAndroid({\n sku: options.skuAndroid,\n packageName: options.packageNameAndroid,\n });\n }\n\n return Promise.reject(new Error(`Unsupported platform: ${Platform.OS}`));\n};\n\nexport * from './useIAP';\nexport * from './utils/errorMapping';\n"]}
@@ -1,4 +1,4 @@
1
- import type { Product, Purchase, PurchaseError, ProductStatusIOS, AppTransactionIOS } from '../ExpoIap.types';
1
+ import type { Product, Purchase, PurchaseError, SubscriptionStatusIOS, AppTransactionIOS } from '../ExpoIap.types';
2
2
  export type TransactionEvent = {
3
3
  transaction?: Purchase;
4
4
  error?: PurchaseError;
@@ -53,7 +53,7 @@ export declare const isEligibleForIntroOfferIOS: (groupId: string) => Promise<bo
53
53
  *
54
54
  * @platform iOS
55
55
  */
56
- export declare const subscriptionStatusIOS: (sku: string) => Promise<ProductStatusIOS[]>;
56
+ export declare const subscriptionStatusIOS: (sku: string) => Promise<SubscriptionStatusIOS[]>;
57
57
  /**
58
58
  * Get current entitlement for a specific SKU
59
59
  *
@@ -197,10 +197,6 @@ export declare const getPromotedProductIOS: () => Promise<Product | null>;
197
197
  * @platform iOS
198
198
  */
199
199
  export declare const requestPurchaseOnPromotedProductIOS: () => Promise<void>;
200
- /**
201
- * @deprecated Use requestPurchaseOnPromotedProductIOS instead. Will be removed in v2.9.0
202
- */
203
- export declare const buyPromotedProductIOS: () => Promise<void>;
204
200
  /**
205
201
  * Get pending transactions that haven't been finished yet (iOS only).
206
202
  *
@@ -233,7 +229,7 @@ export declare const isEligibleForIntroOffer: (groupId: string) => Promise<boole
233
229
  /**
234
230
  * @deprecated Use `subscriptionStatusIOS` instead. This function will be removed in version 3.0.0.
235
231
  */
236
- export declare const subscriptionStatus: (sku: string) => Promise<ProductStatusIOS[]>;
232
+ export declare const subscriptionStatus: (sku: string) => Promise<SubscriptionStatusIOS[]>;
237
233
  /**
238
234
  * @deprecated Use `currentEntitlementIOS` instead. This function will be removed in version 3.0.0.
239
235
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../src/modules/ios.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAGF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI;;CAkC5C,CAAC;AAGF,wBAAgB,YAAY,CAAC,CAAC,SAAS;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAC,EACxD,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,CAAC,GAAG;IAAC,QAAQ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C;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,KAAG,OAAO,CAAC,MAAM,CAK7D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,QAAO,OAAO,CAAC,OAAO,CAK5D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAO,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAKpE,CAAC"}
@@ -241,12 +241,7 @@ export const getPromotedProductIOS = () => {
241
241
  export const requestPurchaseOnPromotedProductIOS = () => {
242
242
  return ExpoIapModule.requestPurchaseOnPromotedProductIOS();
243
243
  };
244
- /**
245
- * @deprecated Use requestPurchaseOnPromotedProductIOS instead. Will be removed in v2.9.0
246
- */
247
- export const buyPromotedProductIOS = () => {
248
- return requestPurchaseOnPromotedProductIOS();
249
- };
244
+ // NOTE: buyPromotedProductIOS removed in v2.9.0. Use requestPurchaseOnPromotedProductIOS.
250
245
  /**
251
246
  * Get pending transactions that haven't been finished yet (iOS only).
252
247
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/modules/ios.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,mBAAmB;AACnB,OAAO,EAAC,uBAAuB,EAAC,MAAM,IAAI,CAAC;AAC3C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAU7C,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAOrC,YAAY;AACZ;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,QAA2C,EAC3C,EAAE;IACF,MAAM,UAAU,GAAG,CAAC,IAAa,EAAoB,EAAE;QACrD,OAAO,CACL,IAAI,IAAI,IAAI;YACZ,OAAO,IAAI,KAAK,QAAQ;YACxB,IAAI,IAAI,IAAI;YACZ,eAAe,IAAI,IAAI;YACvB,UAAU,IAAI,IAAI,CACnB,CAAC;IACJ,CAAC,CAAC;IAEF,iEAAiE;IACjE,MAAM,6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EAAmB,EAAE;IAChE,OAAO,CAAC,IAAI,CACV,wHAAwH,CACzH,CAAC;IACF,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAqB,EAAE;IAC/D,OAAO,CAAC,IAAI,CACV,0IAA0I,CAC3I,CAAC;IACF,OAAO,6BAA6B,EAAE,CAAC;AACzC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAsC,EAAE;IACvE,OAAO,CAAC,IAAI,CACV,wHAAwH,CACzH,CAAC;IACF,OAAO,oBAAoB,EAAE,CAAC;AAChC,CAAC,CAAC","sourcesContent":["// External dependencies\n\n// Internal modules\nimport {purchaseUpdatedListener} from '..';\nimport ExpoIapModule from '../ExpoIapModule';\n\n// Types\nimport type {\n Product,\n Purchase,\n PurchaseError,\n ProductStatusIOS,\n AppTransactionIOS,\n} from '../ExpoIap.types';\nimport {Linking} from 'react-native';\n\nexport type TransactionEvent = {\n transaction?: Purchase;\n error?: PurchaseError;\n};\n\n// Listeners\n/**\n * @deprecated Use `purchaseUpdatedListener` instead. This function will be removed in a future version.\n *\n * The `transactionUpdatedIos` function is redundant as it simply wraps `purchaseUpdatedListener`.\n * You can achieve the same functionality by using `purchaseUpdatedListener` directly.\n *\n * @example\n * // Instead of:\n * // transactionUpdatedIos((event) => { ... });\n *\n * // Use:\n * // purchaseUpdatedListener((purchase) => { ... });\n */\nexport const transactionUpdatedIOS = (\n listener: (event: TransactionEvent) => void,\n) => {\n const isPurchase = (item: unknown): item is Purchase => {\n return (\n item != null &&\n typeof item === 'object' &&\n 'id' in item &&\n 'transactionId' in item &&\n 'platform' in item\n );\n };\n\n // Helper function to safely convert Purchase to TransactionEvent\n const mapPurchaseToTransactionEvent = (\n purchase: Purchase,\n ): TransactionEvent => {\n // Validate the purchase object before casting\n if (isPurchase(purchase)) {\n return {\n transaction: purchase as Purchase,\n };\n }\n\n // Fallback: create a basic TransactionEvent structure\n return {\n transaction: purchase as Purchase,\n };\n };\n\n return purchaseUpdatedListener((purchase) => {\n // Convert Purchase to TransactionEvent format for backward compatibility\n const event = mapPurchaseToTransactionEvent(purchase);\n listener(event);\n });\n};\n\n// Type guards\nexport function isProductIOS<T extends {platform?: string}>(\n item: unknown,\n): item is T & {platform: 'ios'} {\n return (\n item != null &&\n typeof item === 'object' &&\n 'platform' in item &&\n item.platform === 'ios'\n );\n}\n\n// Functions\n/**\n * Sync state with Appstore (iOS only)\n * https://developer.apple.com/documentation/storekit/appstore/3791906-sync\n *\n * @returns Promise resolving to null on success\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const syncIOS = (): Promise<null> => {\n return ExpoIapModule.syncIOS();\n};\n\n/**\n * Check if user is eligible for introductory offer\n *\n * @param groupId The subscription group ID\n * @returns Promise resolving to true if eligible\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const isEligibleForIntroOfferIOS = (\n groupId: string,\n): Promise<boolean> => {\n return ExpoIapModule.isEligibleForIntroOfferIOS(groupId);\n};\n\n/**\n * Get subscription status for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to array of subscription status\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const subscriptionStatusIOS = (\n sku: string,\n): Promise<ProductStatusIOS[]> => {\n return ExpoIapModule.subscriptionStatusIOS(sku);\n};\n\n/**\n * Get current entitlement for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to current entitlement\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const currentEntitlementIOS = (sku: string): Promise<Purchase> => {\n return ExpoIapModule.currentEntitlementIOS(sku);\n};\n\n/**\n * Get latest transaction for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to latest transaction\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const latestTransactionIOS = (sku: string): Promise<Purchase> => {\n return ExpoIapModule.latestTransactionIOS(sku);\n};\n\n/**\n * Begin refund request for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to refund request status\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\ntype RefundRequestStatus = 'success' | 'userCancelled';\nexport const beginRefundRequestIOS = (\n sku: string,\n): Promise<RefundRequestStatus> => {\n return ExpoIapModule.beginRefundRequestIOS(sku);\n};\n\n/**\n * Shows the system UI for managing subscriptions.\n * Returns an array of subscriptions that had status changes after the UI is closed.\n *\n * @returns Promise<Purchase[]> - Array of subscriptions with status changes (e.g., auto-renewal toggled)\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const showManageSubscriptionsIOS = (): Promise<Purchase[]> => {\n return ExpoIapModule.showManageSubscriptionsIOS();\n};\n\n/**\n * Get the receipt data from the iOS device.\n * This returns the base64 encoded receipt data which can be sent to your server\n * for verification with Apple's server.\n *\n * NOTE: For proper security, always verify receipts on your server using\n * Apple's verifyReceipt endpoint, not directly from the app.\n *\n * @returns {Promise<string>} Base64 encoded receipt data\n */\nexport const getReceiptIOS = (): Promise<string> => {\n return ExpoIapModule.getReceiptDataIOS();\n};\n\n/**\n * Check if a transaction is verified through StoreKit 2.\n * StoreKit 2 performs local verification of transaction JWS signatures.\n *\n * @param sku The product's SKU (on iOS)\n * @returns Promise resolving to true if the transaction is verified\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const isTransactionVerifiedIOS = (sku: string): Promise<boolean> => {\n return ExpoIapModule.isTransactionVerifiedIOS(sku);\n};\n\n/**\n * Get the JWS representation of a purchase for server-side verification.\n * The JWS (JSON Web Signature) can be verified on your server using Apple's public keys.\n *\n * @param sku The product's SKU (on iOS)\n * @returns Promise resolving to JWS representation of the transaction\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const getTransactionJwsIOS = (sku: string): Promise<string> => {\n return ExpoIapModule.getTransactionJwsIOS(sku);\n};\n\n/**\n * Validate receipt for iOS using StoreKit 2's built-in verification.\n * Returns receipt data and verification information to help with server-side validation.\n *\n * NOTE: For proper security, Apple recommends verifying receipts on your server using\n * the verifyReceipt endpoint rather than relying solely on client-side verification.\n *\n * @param {string} sku The product's SKU (on iOS)\n * @returns {Promise<{\n * isValid: boolean;\n * receiptData: string;\n * jwsRepresentation: string;\n * latestTransaction?: Purchase;\n * }>}\n */\nexport const validateReceiptIOS = async (\n sku: string,\n): Promise<{\n isValid: boolean;\n receiptData: string;\n jwsRepresentation: string;\n latestTransaction?: Purchase;\n}> => {\n const result = await ExpoIapModule.validateReceiptIOS(sku);\n return result;\n};\n\n/**\n * Present the code redemption sheet for offer codes (iOS only).\n * This allows users to redeem promotional codes for in-app purchases and subscriptions.\n *\n * Note: This only works on real devices, not simulators.\n *\n * @returns Promise resolving to true if the sheet was presented successfully\n * @throws Error if called on non-iOS platform or tvOS\n *\n * @platform iOS\n */\nexport const presentCodeRedemptionSheetIOS = (): Promise<boolean> => {\n return ExpoIapModule.presentCodeRedemptionSheetIOS();\n};\n\n/**\n * Get app transaction information (iOS 16.0+).\n * AppTransaction represents the initial purchase that unlocked the app.\n *\n * NOTE: This function requires:\n * - iOS 16.0 or later at runtime\n * - Xcode 15.0+ with iOS 16.0 SDK for compilation\n *\n * @returns Promise resolving to the app transaction information or null if not available\n * @throws Error if called on non-iOS platform, iOS version < 16.0, or compiled with older SDK\n *\n * @platform iOS\n * @since iOS 16.0\n */\nexport const getAppTransactionIOS = (): Promise<AppTransactionIOS | null> => {\n return ExpoIapModule.getAppTransactionIOS();\n};\n\n/**\n * Get information about a promoted product if one is available (iOS only).\n * Promoted products are products that the App Store promotes on your behalf.\n * This is called after a promoted product event is received from the App Store.\n *\n * @returns Promise resolving to the promoted product information or null if none available\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const getPromotedProductIOS = (): Promise<Product | null> => {\n return ExpoIapModule.getPromotedProductIOS();\n};\n\n/**\n * Complete the purchase of a promoted product (iOS only).\n * This should be called after showing your purchase UI for a promoted product.\n *\n * @returns Promise resolving when the purchase is initiated\n * @throws Error if called on non-iOS platform or no promoted product is available\n *\n * @platform iOS\n */\nexport const requestPurchaseOnPromotedProductIOS = (): Promise<void> => {\n return ExpoIapModule.requestPurchaseOnPromotedProductIOS();\n};\n\n/**\n * @deprecated Use requestPurchaseOnPromotedProductIOS instead. Will be removed in v2.9.0\n */\nexport const buyPromotedProductIOS = (): Promise<void> => {\n return requestPurchaseOnPromotedProductIOS();\n};\n\n/**\n * Get pending transactions that haven't been finished yet (iOS only).\n *\n * @returns Promise resolving to array of pending transactions\n * @platform iOS\n */\nexport const getPendingTransactionsIOS = (): Promise<any[]> => {\n return ExpoIapModule.getPendingTransactionsIOS();\n};\n\n/**\n * Clear a specific transaction (iOS only).\n *\n * @returns Promise resolving when transaction is cleared\n * @platform iOS\n */\nexport const clearTransactionIOS = (): Promise<void> => {\n return ExpoIapModule.clearTransactionIOS();\n};\n\n/**\n * Deep link to subscriptions screen on iOS.\n * @returns {Promise<void>}\n *\n * @platform iOS\n */\nexport const deepLinkToSubscriptionsIOS = (): Promise<void> =>\n Linking.openURL('https://apps.apple.com/account/subscriptions');\n\n// ============= DEPRECATED FUNCTIONS =============\n// These will be removed in version 3.0.0\n\n/**\n * @deprecated Use `syncIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const sync = (): Promise<null> => {\n console.warn(\n '`sync` is deprecated. Use `syncIOS` instead. This function will be removed in version 3.0.0.',\n );\n return syncIOS();\n};\n\n/**\n * @deprecated Use `isEligibleForIntroOfferIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const isEligibleForIntroOffer = (groupId: string): Promise<boolean> => {\n console.warn(\n '`isEligibleForIntroOffer` is deprecated. Use `isEligibleForIntroOfferIOS` instead. This function will be removed in version 3.0.0.',\n );\n return isEligibleForIntroOfferIOS(groupId);\n};\n\n/**\n * @deprecated Use `subscriptionStatusIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const subscriptionStatus = (\n sku: string,\n): Promise<ProductStatusIOS[]> => {\n console.warn(\n '`subscriptionStatus` is deprecated. Use `subscriptionStatusIOS` instead. This function will be removed in version 3.0.0.',\n );\n return subscriptionStatusIOS(sku);\n};\n\n/**\n * @deprecated Use `currentEntitlementIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const currentEntitlement = (sku: string): Promise<Purchase> => {\n console.warn(\n '`currentEntitlement` is deprecated. Use `currentEntitlementIOS` instead. This function will be removed in version 3.0.0.',\n );\n return currentEntitlementIOS(sku);\n};\n\n/**\n * @deprecated Use `latestTransactionIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const latestTransaction = (sku: string): Promise<Purchase> => {\n console.warn(\n '`latestTransaction` is deprecated. Use `latestTransactionIOS` instead. This function will be removed in version 3.0.0.',\n );\n return latestTransactionIOS(sku);\n};\n\n/**\n * @deprecated Use `beginRefundRequestIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const beginRefundRequest = (\n sku: string,\n): Promise<RefundRequestStatus> => {\n console.warn(\n '`beginRefundRequest` is deprecated. Use `beginRefundRequestIOS` instead. This function will be removed in version 3.0.0.',\n );\n return beginRefundRequestIOS(sku);\n};\n\n/**\n * @deprecated Use `showManageSubscriptionsIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const showManageSubscriptions = (): Promise<Purchase[]> => {\n console.warn(\n '`showManageSubscriptions` is deprecated. Use `showManageSubscriptionsIOS` instead. This function will be removed in version 3.0.0.',\n );\n return showManageSubscriptionsIOS();\n};\n\n/**\n * @deprecated Use `isTransactionVerifiedIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const isTransactionVerified = (sku: string): Promise<boolean> => {\n console.warn(\n '`isTransactionVerified` is deprecated. Use `isTransactionVerifiedIOS` instead. This function will be removed in version 3.0.0.',\n );\n return isTransactionVerifiedIOS(sku);\n};\n\n/**\n * @deprecated Use `getTransactionJwsIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const getTransactionJws = (sku: string): Promise<string> => {\n console.warn(\n '`getTransactionJws` is deprecated. Use `getTransactionJwsIOS` instead. This function will be removed in version 3.0.0.',\n );\n return getTransactionJwsIOS(sku);\n};\n\n/**\n * @deprecated Use `presentCodeRedemptionSheetIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const presentCodeRedemptionSheet = (): Promise<boolean> => {\n console.warn(\n '`presentCodeRedemptionSheet` is deprecated. Use `presentCodeRedemptionSheetIOS` instead. This function will be removed in version 3.0.0.',\n );\n return presentCodeRedemptionSheetIOS();\n};\n\n/**\n * @deprecated Use `getAppTransactionIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const getAppTransaction = (): Promise<AppTransactionIOS | null> => {\n console.warn(\n '`getAppTransaction` is deprecated. Use `getAppTransactionIOS` instead. This function will be removed in version 3.0.0.',\n );\n return getAppTransactionIOS();\n};\n"]}
1
+ {"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/modules/ios.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,mBAAmB;AACnB,OAAO,EAAC,uBAAuB,EAAC,MAAM,IAAI,CAAC;AAC3C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAU7C,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAOrC,YAAY;AACZ;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,QAA2C,EAC3C,EAAE;IACF,MAAM,UAAU,GAAG,CAAC,IAAa,EAAoB,EAAE;QACrD,OAAO,CACL,IAAI,IAAI,IAAI;YACZ,OAAO,IAAI,KAAK,QAAQ;YACxB,IAAI,IAAI,IAAI;YACZ,eAAe,IAAI,IAAI;YACvB,UAAU,IAAI,IAAI,CACnB,CAAC;IACJ,CAAC,CAAC;IAEF,iEAAiE;IACjE,MAAM,6BAA6B,GAAG,CACpC,QAAkB,EACA,EAAE;QACpB,8CAA8C;QAC9C,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzB,OAAO;gBACL,WAAW,EAAE,QAAoB;aAClC,CAAC;QAC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B,EAAE,CAAC;AACzC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAsC,EAAE;IACvE,OAAO,CAAC,IAAI,CACV,wHAAwH,CACzH,CAAC;IACF,OAAO,oBAAoB,EAAE,CAAC;AAChC,CAAC,CAAC","sourcesContent":["// External dependencies\n\n// Internal modules\nimport {purchaseUpdatedListener} from '..';\nimport ExpoIapModule from '../ExpoIapModule';\n\n// Types\nimport type {\n Product,\n Purchase,\n PurchaseError,\n SubscriptionStatusIOS,\n AppTransactionIOS,\n} from '../ExpoIap.types';\nimport {Linking} from 'react-native';\n\nexport type TransactionEvent = {\n transaction?: Purchase;\n error?: PurchaseError;\n};\n\n// Listeners\n/**\n * @deprecated Use `purchaseUpdatedListener` instead. This function will be removed in a future version.\n *\n * The `transactionUpdatedIos` function is redundant as it simply wraps `purchaseUpdatedListener`.\n * You can achieve the same functionality by using `purchaseUpdatedListener` directly.\n *\n * @example\n * // Instead of:\n * // transactionUpdatedIos((event) => { ... });\n *\n * // Use:\n * // purchaseUpdatedListener((purchase) => { ... });\n */\nexport const transactionUpdatedIOS = (\n listener: (event: TransactionEvent) => void,\n) => {\n const isPurchase = (item: unknown): item is Purchase => {\n return (\n item != null &&\n typeof item === 'object' &&\n 'id' in item &&\n 'transactionId' in item &&\n 'platform' in item\n );\n };\n\n // Helper function to safely convert Purchase to TransactionEvent\n const mapPurchaseToTransactionEvent = (\n purchase: Purchase,\n ): TransactionEvent => {\n // Validate the purchase object before casting\n if (isPurchase(purchase)) {\n return {\n transaction: purchase as Purchase,\n };\n }\n\n // Fallback: create a basic TransactionEvent structure\n return {\n transaction: purchase as Purchase,\n };\n };\n\n return purchaseUpdatedListener((purchase) => {\n // Convert Purchase to TransactionEvent format for backward compatibility\n const event = mapPurchaseToTransactionEvent(purchase);\n listener(event);\n });\n};\n\n// Type guards\nexport function isProductIOS<T extends {platform?: string}>(\n item: unknown,\n): item is T & {platform: 'ios'} {\n return (\n item != null &&\n typeof item === 'object' &&\n 'platform' in item &&\n item.platform === 'ios'\n );\n}\n\n// Functions\n/**\n * Sync state with Appstore (iOS only)\n * https://developer.apple.com/documentation/storekit/appstore/3791906-sync\n *\n * @returns Promise resolving to null on success\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const syncIOS = (): Promise<null> => {\n return ExpoIapModule.syncIOS();\n};\n\n/**\n * Check if user is eligible for introductory offer\n *\n * @param groupId The subscription group ID\n * @returns Promise resolving to true if eligible\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const isEligibleForIntroOfferIOS = (\n groupId: string,\n): Promise<boolean> => {\n return ExpoIapModule.isEligibleForIntroOfferIOS(groupId);\n};\n\n/**\n * Get subscription status for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to array of subscription status\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const subscriptionStatusIOS = (\n sku: string,\n): Promise<SubscriptionStatusIOS[]> => {\n return ExpoIapModule.subscriptionStatusIOS(sku);\n};\n\n/**\n * Get current entitlement for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to current entitlement\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const currentEntitlementIOS = (sku: string): Promise<Purchase> => {\n return ExpoIapModule.currentEntitlementIOS(sku);\n};\n\n/**\n * Get latest transaction for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to latest transaction\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const latestTransactionIOS = (sku: string): Promise<Purchase> => {\n return ExpoIapModule.latestTransactionIOS(sku);\n};\n\n/**\n * Begin refund request for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to refund request status\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\ntype RefundRequestStatus = 'success' | 'userCancelled';\nexport const beginRefundRequestIOS = (\n sku: string,\n): Promise<RefundRequestStatus> => {\n return ExpoIapModule.beginRefundRequestIOS(sku);\n};\n\n/**\n * Shows the system UI for managing subscriptions.\n * Returns an array of subscriptions that had status changes after the UI is closed.\n *\n * @returns Promise<Purchase[]> - Array of subscriptions with status changes (e.g., auto-renewal toggled)\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const showManageSubscriptionsIOS = (): Promise<Purchase[]> => {\n return ExpoIapModule.showManageSubscriptionsIOS();\n};\n\n/**\n * Get the receipt data from the iOS device.\n * This returns the base64 encoded receipt data which can be sent to your server\n * for verification with Apple's server.\n *\n * NOTE: For proper security, always verify receipts on your server using\n * Apple's verifyReceipt endpoint, not directly from the app.\n *\n * @returns {Promise<string>} Base64 encoded receipt data\n */\nexport const getReceiptIOS = (): Promise<string> => {\n return ExpoIapModule.getReceiptDataIOS();\n};\n\n/**\n * Check if a transaction is verified through StoreKit 2.\n * StoreKit 2 performs local verification of transaction JWS signatures.\n *\n * @param sku The product's SKU (on iOS)\n * @returns Promise resolving to true if the transaction is verified\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const isTransactionVerifiedIOS = (sku: string): Promise<boolean> => {\n return ExpoIapModule.isTransactionVerifiedIOS(sku);\n};\n\n/**\n * Get the JWS representation of a purchase for server-side verification.\n * The JWS (JSON Web Signature) can be verified on your server using Apple's public keys.\n *\n * @param sku The product's SKU (on iOS)\n * @returns Promise resolving to JWS representation of the transaction\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const getTransactionJwsIOS = (sku: string): Promise<string> => {\n return ExpoIapModule.getTransactionJwsIOS(sku);\n};\n\n/**\n * Validate receipt for iOS using StoreKit 2's built-in verification.\n * Returns receipt data and verification information to help with server-side validation.\n *\n * NOTE: For proper security, Apple recommends verifying receipts on your server using\n * the verifyReceipt endpoint rather than relying solely on client-side verification.\n *\n * @param {string} sku The product's SKU (on iOS)\n * @returns {Promise<{\n * isValid: boolean;\n * receiptData: string;\n * jwsRepresentation: string;\n * latestTransaction?: Purchase;\n * }>}\n */\nexport const validateReceiptIOS = async (\n sku: string,\n): Promise<{\n isValid: boolean;\n receiptData: string;\n jwsRepresentation: string;\n latestTransaction?: Purchase;\n}> => {\n const result = await ExpoIapModule.validateReceiptIOS(sku);\n return result;\n};\n\n/**\n * Present the code redemption sheet for offer codes (iOS only).\n * This allows users to redeem promotional codes for in-app purchases and subscriptions.\n *\n * Note: This only works on real devices, not simulators.\n *\n * @returns Promise resolving to true if the sheet was presented successfully\n * @throws Error if called on non-iOS platform or tvOS\n *\n * @platform iOS\n */\nexport const presentCodeRedemptionSheetIOS = (): Promise<boolean> => {\n return ExpoIapModule.presentCodeRedemptionSheetIOS();\n};\n\n/**\n * Get app transaction information (iOS 16.0+).\n * AppTransaction represents the initial purchase that unlocked the app.\n *\n * NOTE: This function requires:\n * - iOS 16.0 or later at runtime\n * - Xcode 15.0+ with iOS 16.0 SDK for compilation\n *\n * @returns Promise resolving to the app transaction information or null if not available\n * @throws Error if called on non-iOS platform, iOS version < 16.0, or compiled with older SDK\n *\n * @platform iOS\n * @since iOS 16.0\n */\nexport const getAppTransactionIOS = (): Promise<AppTransactionIOS | null> => {\n return ExpoIapModule.getAppTransactionIOS();\n};\n\n/**\n * Get information about a promoted product if one is available (iOS only).\n * Promoted products are products that the App Store promotes on your behalf.\n * This is called after a promoted product event is received from the App Store.\n *\n * @returns Promise resolving to the promoted product information or null if none available\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const getPromotedProductIOS = (): Promise<Product | null> => {\n return ExpoIapModule.getPromotedProductIOS();\n};\n\n/**\n * Complete the purchase of a promoted product (iOS only).\n * This should be called after showing your purchase UI for a promoted product.\n *\n * @returns Promise resolving when the purchase is initiated\n * @throws Error if called on non-iOS platform or no promoted product is available\n *\n * @platform iOS\n */\nexport const requestPurchaseOnPromotedProductIOS = (): Promise<void> => {\n return ExpoIapModule.requestPurchaseOnPromotedProductIOS();\n};\n\n// NOTE: buyPromotedProductIOS removed in v2.9.0. Use requestPurchaseOnPromotedProductIOS.\n\n/**\n * Get pending transactions that haven't been finished yet (iOS only).\n *\n * @returns Promise resolving to array of pending transactions\n * @platform iOS\n */\nexport const getPendingTransactionsIOS = (): Promise<any[]> => {\n return ExpoIapModule.getPendingTransactionsIOS();\n};\n\n/**\n * Clear a specific transaction (iOS only).\n *\n * @returns Promise resolving when transaction is cleared\n * @platform iOS\n */\nexport const clearTransactionIOS = (): Promise<void> => {\n return ExpoIapModule.clearTransactionIOS();\n};\n\n/**\n * Deep link to subscriptions screen on iOS.\n * @returns {Promise<void>}\n *\n * @platform iOS\n */\nexport const deepLinkToSubscriptionsIOS = (): Promise<void> =>\n Linking.openURL('https://apps.apple.com/account/subscriptions');\n\n// ============= DEPRECATED FUNCTIONS =============\n// These will be removed in version 3.0.0\n\n/**\n * @deprecated Use `syncIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const sync = (): Promise<null> => {\n console.warn(\n '`sync` is deprecated. Use `syncIOS` instead. This function will be removed in version 3.0.0.',\n );\n return syncIOS();\n};\n\n/**\n * @deprecated Use `isEligibleForIntroOfferIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const isEligibleForIntroOffer = (groupId: string): Promise<boolean> => {\n console.warn(\n '`isEligibleForIntroOffer` is deprecated. Use `isEligibleForIntroOfferIOS` instead. This function will be removed in version 3.0.0.',\n );\n return isEligibleForIntroOfferIOS(groupId);\n};\n\n/**\n * @deprecated Use `subscriptionStatusIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const subscriptionStatus = (\n sku: string,\n): Promise<SubscriptionStatusIOS[]> => {\n console.warn(\n '`subscriptionStatus` is deprecated. Use `subscriptionStatusIOS` instead. This function will be removed in version 3.0.0.',\n );\n return subscriptionStatusIOS(sku);\n};\n\n/**\n * @deprecated Use `currentEntitlementIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const currentEntitlement = (sku: string): Promise<Purchase> => {\n console.warn(\n '`currentEntitlement` is deprecated. Use `currentEntitlementIOS` instead. This function will be removed in version 3.0.0.',\n );\n return currentEntitlementIOS(sku);\n};\n\n/**\n * @deprecated Use `latestTransactionIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const latestTransaction = (sku: string): Promise<Purchase> => {\n console.warn(\n '`latestTransaction` is deprecated. Use `latestTransactionIOS` instead. This function will be removed in version 3.0.0.',\n );\n return latestTransactionIOS(sku);\n};\n\n/**\n * @deprecated Use `beginRefundRequestIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const beginRefundRequest = (\n sku: string,\n): Promise<RefundRequestStatus> => {\n console.warn(\n '`beginRefundRequest` is deprecated. Use `beginRefundRequestIOS` instead. This function will be removed in version 3.0.0.',\n );\n return beginRefundRequestIOS(sku);\n};\n\n/**\n * @deprecated Use `showManageSubscriptionsIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const showManageSubscriptions = (): Promise<Purchase[]> => {\n console.warn(\n '`showManageSubscriptions` is deprecated. Use `showManageSubscriptionsIOS` instead. This function will be removed in version 3.0.0.',\n );\n return showManageSubscriptionsIOS();\n};\n\n/**\n * @deprecated Use `isTransactionVerifiedIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const isTransactionVerified = (sku: string): Promise<boolean> => {\n console.warn(\n '`isTransactionVerified` is deprecated. Use `isTransactionVerifiedIOS` instead. This function will be removed in version 3.0.0.',\n );\n return isTransactionVerifiedIOS(sku);\n};\n\n/**\n * @deprecated Use `getTransactionJwsIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const getTransactionJws = (sku: string): Promise<string> => {\n console.warn(\n '`getTransactionJws` is deprecated. Use `getTransactionJwsIOS` instead. This function will be removed in version 3.0.0.',\n );\n return getTransactionJwsIOS(sku);\n};\n\n/**\n * @deprecated Use `presentCodeRedemptionSheetIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const presentCodeRedemptionSheet = (): Promise<boolean> => {\n console.warn(\n '`presentCodeRedemptionSheet` is deprecated. Use `presentCodeRedemptionSheetIOS` instead. This function will be removed in version 3.0.0.',\n );\n return presentCodeRedemptionSheetIOS();\n};\n\n/**\n * @deprecated Use `getAppTransactionIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const getAppTransaction = (): Promise<AppTransactionIOS | null> => {\n console.warn(\n '`getAppTransaction` is deprecated. Use `getAppTransactionIOS` instead. This function will be removed in version 3.0.0.',\n );\n return getAppTransactionIOS();\n};\n"]}
@@ -27,18 +27,6 @@ export type ProductAndroid = ProductCommon & {
27
27
  oneTimePurchaseOfferDetailsAndroid?: ProductAndroidOneTimePurchaseOfferDetail;
28
28
  platform: 'android';
29
29
  subscriptionOfferDetailsAndroid?: ProductSubscriptionAndroidOfferDetail[];
30
- /**
31
- * @deprecated Use `nameAndroid` instead. This field will be removed in v2.9.0.
32
- */
33
- name?: string;
34
- /**
35
- * @deprecated Use `oneTimePurchaseOfferDetailsAndroid` instead. This field will be removed in v2.9.0.
36
- */
37
- oneTimePurchaseOfferDetails?: ProductAndroidOneTimePurchaseOfferDetail;
38
- /**
39
- * @deprecated Use `subscriptionOfferDetailsAndroid` instead. This field will be removed in v2.9.0.
40
- */
41
- subscriptionOfferDetails?: ProductSubscriptionAndroidOfferDetail[];
42
30
  };
43
31
  type ProductSubscriptionAndroidOfferDetails = {
44
32
  basePlanId: string;
@@ -49,10 +37,6 @@ type ProductSubscriptionAndroidOfferDetails = {
49
37
  };
50
38
  export type ProductSubscriptionAndroid = ProductAndroid & {
51
39
  subscriptionOfferDetailsAndroid: ProductSubscriptionAndroidOfferDetails[];
52
- /**
53
- * @deprecated Use `subscriptionOfferDetailsAndroid` instead. This field will be removed in v2.9.0.
54
- */
55
- subscriptionOfferDetails?: ProductSubscriptionAndroidOfferDetails[];
56
40
  };
57
41
  export type SubscriptionProductAndroid = ProductSubscriptionAndroid;
58
42
  export type RequestPurchaseAndroidProps = {
@@ -118,10 +102,6 @@ export declare enum PurchaseAndroidState {
118
102
  PURCHASED = 1,
119
103
  PENDING = 2
120
104
  }
121
- /**
122
- * @deprecated Use `PurchaseAndroidState` instead. This enum will be removed in v2.9.0.
123
- */
124
- export declare const PurchaseStateAndroid: typeof PurchaseAndroidState;
125
105
  export type ProductPurchaseAndroid = PurchaseCommon & {
126
106
  platform: 'android';
127
107
  /**
@@ -139,17 +119,5 @@ export type ProductPurchaseAndroid = PurchaseCommon & {
139
119
  obfuscatedProfileIdAndroid?: string;
140
120
  };
141
121
  export type PurchaseAndroid = ProductPurchaseAndroid;
142
- /**
143
- * @deprecated Use `ProductAndroidOneTimePurchaseOfferDetail` instead. This type will be removed in v2.9.0.
144
- */
145
- export type OneTimePurchaseOfferDetails = ProductAndroidOneTimePurchaseOfferDetail;
146
- /**
147
- * @deprecated Use `ProductSubscriptionAndroidOfferDetail` instead. This type will be removed in v2.9.0.
148
- */
149
- export type SubscriptionOfferDetail = ProductSubscriptionAndroidOfferDetail;
150
- /**
151
- * @deprecated Use `ProductSubscriptionAndroidOfferDetails` instead. This type will be removed in v2.9.0.
152
- */
153
- export type SubscriptionOfferAndroid = ProductSubscriptionAndroidOfferDetails;
154
122
  export {};
155
123
  //# sourceMappingURL=ExpoIapAndroid.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoIapAndroid.types.d.ts","sourceRoot":"","sources":["../../src/types/ExpoIapAndroid.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/D,KAAK,wCAAwC,GAAG;IAC9C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAE1B,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,gBAAgB,EAAE,mB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IACxC,aAAa,kBAAkB;IAC/B,oCAAoC;IACpC,oBAAoB,yBAAyB;CAC9C;AAED,oBAAY,oBAAoB;IAC9B,iBAAiB,IAAI;IACrB,SAAS,IAAI;IACb,OAAO,IAAI;CACZ;AAMD,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG;IACpD,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG,sBAAsB,CAAC"}
@@ -26,9 +26,5 @@ export var PurchaseAndroidState;
26
26
  PurchaseAndroidState[PurchaseAndroidState["PURCHASED"] = 1] = "PURCHASED";
27
27
  PurchaseAndroidState[PurchaseAndroidState["PENDING"] = 2] = "PENDING";
28
28
  })(PurchaseAndroidState || (PurchaseAndroidState = {}));
29
- // Legacy naming for backward compatibility
30
- /**
31
- * @deprecated Use `PurchaseAndroidState` instead. This enum will be removed in v2.9.0.
32
- */
33
- export const PurchaseStateAndroid = PurchaseAndroidState;
29
+ // Removed legacy Android alias types in v2.9.0
34
30
  //# sourceMappingURL=ExpoIapAndroid.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoIapAndroid.types.js","sourceRoot":"","sources":["../../src/types/ExpoIapAndroid.types.ts"],"names":[],"mappings":"AA2EA,IAAK,uBAOJ;AAPD,WAAK,uBAAuB;IAC1B,6GAA4B,CAAA;IAC5B,mGAAuB,CAAA;IACvB,uGAAyB,CAAA;IACzB,+FAAqB,CAAA;IACrB,+FAAqB,CAAA;IACrB,6EAAY,CAAA;AACd,CAAC,EAPI,uBAAuB,KAAvB,uBAAuB,QAO3B;AAqCD,MAAM,CAAN,IAAY,kBAWX;AAXD,WAAY,kBAAkB;IAC5B,0EAA0E;IAC1E,2DAAqC,CAAA;IACrC,+CAA+C;IAC/C,6EAAuD,CAAA;IACvD,oFAAoF;IACpF,yDAAmC,CAAA;IACnC,wCAAwC;IACxC,qDAA+B,CAAA;IAC/B,oCAAoC;IACpC,mEAA6C,CAAA;AAC/C,CAAC,EAXW,kBAAkB,KAAlB,kBAAkB,QAW7B;AAED,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,yFAAqB,CAAA;IACrB,yEAAa,CAAA;IACb,qEAAW,CAAA;AACb,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAED,2CAA2C;AAC3C;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC","sourcesContent":["import {PurchaseCommon, ProductCommon} from '../ExpoIap.types';\n\ntype ProductAndroidOneTimePurchaseOfferDetail = {\n priceCurrencyCode: string;\n formattedPrice: string;\n priceAmountMicros: string;\n};\n\ntype PricingPhaseAndroid = {\n formattedPrice: string;\n priceCurrencyCode: string;\n // P1W, P1M, P1Y\n billingPeriod: string;\n billingCycleCount: number;\n priceAmountMicros: string;\n recurrenceMode: number;\n};\n\ntype PricingPhasesAndroid = {\n pricingPhaseList: PricingPhaseAndroid[];\n};\n\ntype ProductSubscriptionAndroidOfferDetail = {\n basePlanId: string;\n offerId: string | null;\n offerToken: string;\n offerTags: string[];\n pricingPhases: PricingPhasesAndroid;\n};\n\nexport type ProductAndroid = ProductCommon & {\n nameAndroid: string;\n oneTimePurchaseOfferDetailsAndroid?: ProductAndroidOneTimePurchaseOfferDetail;\n platform: 'android';\n subscriptionOfferDetailsAndroid?: ProductSubscriptionAndroidOfferDetail[];\n /**\n * @deprecated Use `nameAndroid` instead. This field will be removed in v2.9.0.\n */\n name?: string;\n /**\n * @deprecated Use `oneTimePurchaseOfferDetailsAndroid` instead. This field will be removed in v2.9.0.\n */\n oneTimePurchaseOfferDetails?: ProductAndroidOneTimePurchaseOfferDetail;\n /**\n * @deprecated Use `subscriptionOfferDetailsAndroid` instead. This field will be removed in v2.9.0.\n */\n subscriptionOfferDetails?: ProductSubscriptionAndroidOfferDetail[];\n};\n\ntype ProductSubscriptionAndroidOfferDetails = {\n basePlanId: string;\n offerId: string | null;\n offerToken: string;\n pricingPhases: PricingPhasesAndroid;\n offerTags: string[];\n};\n\nexport type ProductSubscriptionAndroid = ProductAndroid & {\n subscriptionOfferDetailsAndroid: ProductSubscriptionAndroidOfferDetails[];\n /**\n * @deprecated Use `subscriptionOfferDetailsAndroid` instead. This field will be removed in v2.9.0.\n */\n subscriptionOfferDetails?: ProductSubscriptionAndroidOfferDetails[];\n};\n\n// Legacy naming for backward compatibility\nexport type SubscriptionProductAndroid = ProductSubscriptionAndroid;\n\nexport type RequestPurchaseAndroidProps = {\n skus: string[];\n obfuscatedAccountIdAndroid?: string;\n obfuscatedProfileIdAndroid?: string;\n isOfferPersonalized?: boolean; // For AndroidBilling V5 https://developer.android.com/google/play/billing/integrate#personalized-price\n};\n\nenum ReplacementModesAndroid {\n UNKNOWN_REPLACEMENT_MODE = 0,\n WITH_TIME_PRORATION = 1,\n CHARGE_PRORATED_PRICE = 2,\n WITHOUT_PRORATION = 3,\n CHARGE_FULL_PRICE = 5,\n DEFERRED = 6,\n}\n\ntype SubscriptionOffer = {\n sku: string;\n offerToken: string;\n};\n\nexport type RequestSubscriptionAndroidProps = RequestPurchaseAndroidProps & {\n /**\n * @deprecated Use `purchaseToken` instead. This field will be removed in a future version.\n */\n purchaseTokenAndroid?: string;\n replacementModeAndroid?: ReplacementModesAndroid;\n subscriptionOffers: SubscriptionOffer[];\n};\n\nexport type ReceiptAndroid = {\n autoRenewing: boolean;\n betaProduct: boolean;\n cancelDate: number | null;\n cancelReason: string;\n deferredDate: number | null;\n deferredSku: number | null;\n freeTrialEndDate: number;\n gracePeriodEndDate: number;\n parentProductId: string;\n productId: string;\n productType: string;\n purchaseDate: number;\n quantity: number;\n receiptId: string;\n renewalDate: number;\n term: string;\n termSku: string;\n testTransaction: boolean;\n};\n\nexport enum FeatureTypeAndroid {\n /** Show in-app messages. Included in documentation by the annotations: */\n IN_APP_MESSAGING = 'IN_APP_MESSAGING',\n /** Launch a price change confirmation flow. */\n PRICE_CHANGE_CONFIRMATION = 'PRICE_CHANGE_CONFIRMATION',\n /** Play billing library support for querying and purchasing with ProductDetails. */\n PRODUCT_DETAILS = 'PRODUCT_DETAILS',\n /** Purchase/query for subscriptions. */\n SUBSCRIPTIONS = 'SUBSCRIPTIONS',\n /** Subscriptions update/replace. */\n SUBSCRIPTIONS_UPDATE = 'SUBSCRIPTIONS_UPDATE',\n}\n\nexport enum PurchaseAndroidState {\n UNSPECIFIED_STATE = 0,\n PURCHASED = 1,\n PENDING = 2,\n}\n\n// Legacy naming for backward compatibility\n/**\n * @deprecated Use `PurchaseAndroidState` instead. This enum will be removed in v2.9.0.\n */\nexport const PurchaseStateAndroid = PurchaseAndroidState;\n\n// Legacy naming for backward compatibility\nexport type ProductPurchaseAndroid = PurchaseCommon & {\n platform: 'android';\n /**\n * @deprecated Use `purchaseToken` instead. This field will be removed in a future version.\n */\n purchaseTokenAndroid?: string;\n dataAndroid?: string;\n signatureAndroid?: string;\n autoRenewingAndroid?: boolean;\n purchaseStateAndroid?: PurchaseAndroidState;\n isAcknowledgedAndroid?: boolean;\n packageNameAndroid?: string;\n developerPayloadAndroid?: string;\n obfuscatedAccountIdAndroid?: string;\n obfuscatedProfileIdAndroid?: string;\n};\n\n// Preferred naming\nexport type PurchaseAndroid = ProductPurchaseAndroid;\n\n// Legacy type aliases for backward compatibility\n/**\n * @deprecated Use `ProductAndroidOneTimePurchaseOfferDetail` instead. This type will be removed in v2.9.0.\n */\nexport type OneTimePurchaseOfferDetails =\n ProductAndroidOneTimePurchaseOfferDetail;\n\n/**\n * @deprecated Use `ProductSubscriptionAndroidOfferDetail` instead. This type will be removed in v2.9.0.\n */\nexport type SubscriptionOfferDetail = ProductSubscriptionAndroidOfferDetail;\n\n/**\n * @deprecated Use `ProductSubscriptionAndroidOfferDetails` instead. This type will be removed in v2.9.0.\n */\nexport type SubscriptionOfferAndroid = ProductSubscriptionAndroidOfferDetails;\n"]}
1
+ {"version":3,"file":"ExpoIapAndroid.types.js","sourceRoot":"","sources":["../../src/types/ExpoIapAndroid.types.ts"],"names":[],"mappings":"AA2DA,IAAK,uBAOJ;AAPD,WAAK,uBAAuB;IAC1B,6GAA4B,CAAA;IAC5B,mGAAuB,CAAA;IACvB,uGAAyB,CAAA;IACzB,+FAAqB,CAAA;IACrB,+FAAqB,CAAA;IACrB,6EAAY,CAAA;AACd,CAAC,EAPI,uBAAuB,KAAvB,uBAAuB,QAO3B;AAqCD,MAAM,CAAN,IAAY,kBAWX;AAXD,WAAY,kBAAkB;IAC5B,0EAA0E;IAC1E,2DAAqC,CAAA;IACrC,+CAA+C;IAC/C,6EAAuD,CAAA;IACvD,oFAAoF;IACpF,yDAAmC,CAAA;IACnC,wCAAwC;IACxC,qDAA+B,CAAA;IAC/B,oCAAoC;IACpC,mEAA6C,CAAA;AAC/C,CAAC,EAXW,kBAAkB,KAAlB,kBAAkB,QAW7B;AAED,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,yFAAqB,CAAA;IACrB,yEAAa,CAAA;IACb,qEAAW,CAAA;AACb,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AA0BD,+CAA+C","sourcesContent":["import {PurchaseCommon, ProductCommon} from '../ExpoIap.types';\n\ntype ProductAndroidOneTimePurchaseOfferDetail = {\n priceCurrencyCode: string;\n formattedPrice: string;\n priceAmountMicros: string;\n};\n\ntype PricingPhaseAndroid = {\n formattedPrice: string;\n priceCurrencyCode: string;\n // P1W, P1M, P1Y\n billingPeriod: string;\n billingCycleCount: number;\n priceAmountMicros: string;\n recurrenceMode: number;\n};\n\ntype PricingPhasesAndroid = {\n pricingPhaseList: PricingPhaseAndroid[];\n};\n\ntype ProductSubscriptionAndroidOfferDetail = {\n basePlanId: string;\n offerId: string | null;\n offerToken: string;\n offerTags: string[];\n pricingPhases: PricingPhasesAndroid;\n};\n\nexport type ProductAndroid = ProductCommon & {\n nameAndroid: string;\n oneTimePurchaseOfferDetailsAndroid?: ProductAndroidOneTimePurchaseOfferDetail;\n platform: 'android';\n subscriptionOfferDetailsAndroid?: ProductSubscriptionAndroidOfferDetail[];\n};\n\ntype ProductSubscriptionAndroidOfferDetails = {\n basePlanId: string;\n offerId: string | null;\n offerToken: string;\n pricingPhases: PricingPhasesAndroid;\n offerTags: string[];\n};\n\nexport type ProductSubscriptionAndroid = ProductAndroid & {\n subscriptionOfferDetailsAndroid: ProductSubscriptionAndroidOfferDetails[];\n};\n\n// Legacy naming for backward compatibility\nexport type SubscriptionProductAndroid = ProductSubscriptionAndroid;\n\nexport type RequestPurchaseAndroidProps = {\n skus: string[];\n obfuscatedAccountIdAndroid?: string;\n obfuscatedProfileIdAndroid?: string;\n isOfferPersonalized?: boolean; // For AndroidBilling V5 https://developer.android.com/google/play/billing/integrate#personalized-price\n};\n\nenum ReplacementModesAndroid {\n UNKNOWN_REPLACEMENT_MODE = 0,\n WITH_TIME_PRORATION = 1,\n CHARGE_PRORATED_PRICE = 2,\n WITHOUT_PRORATION = 3,\n CHARGE_FULL_PRICE = 5,\n DEFERRED = 6,\n}\n\ntype SubscriptionOffer = {\n sku: string;\n offerToken: string;\n};\n\nexport type RequestSubscriptionAndroidProps = RequestPurchaseAndroidProps & {\n /**\n * @deprecated Use `purchaseToken` instead. This field will be removed in a future version.\n */\n purchaseTokenAndroid?: string;\n replacementModeAndroid?: ReplacementModesAndroid;\n subscriptionOffers: SubscriptionOffer[];\n};\n\nexport type ReceiptAndroid = {\n autoRenewing: boolean;\n betaProduct: boolean;\n cancelDate: number | null;\n cancelReason: string;\n deferredDate: number | null;\n deferredSku: number | null;\n freeTrialEndDate: number;\n gracePeriodEndDate: number;\n parentProductId: string;\n productId: string;\n productType: string;\n purchaseDate: number;\n quantity: number;\n receiptId: string;\n renewalDate: number;\n term: string;\n termSku: string;\n testTransaction: boolean;\n};\n\nexport enum FeatureTypeAndroid {\n /** Show in-app messages. Included in documentation by the annotations: */\n IN_APP_MESSAGING = 'IN_APP_MESSAGING',\n /** Launch a price change confirmation flow. */\n PRICE_CHANGE_CONFIRMATION = 'PRICE_CHANGE_CONFIRMATION',\n /** Play billing library support for querying and purchasing with ProductDetails. */\n PRODUCT_DETAILS = 'PRODUCT_DETAILS',\n /** Purchase/query for subscriptions. */\n SUBSCRIPTIONS = 'SUBSCRIPTIONS',\n /** Subscriptions update/replace. */\n SUBSCRIPTIONS_UPDATE = 'SUBSCRIPTIONS_UPDATE',\n}\n\nexport enum PurchaseAndroidState {\n UNSPECIFIED_STATE = 0,\n PURCHASED = 1,\n PENDING = 2,\n}\n\n// Legacy naming for backward compatibility\n// Removed legacy alias `PurchaseStateAndroid` in v2.9.0\n\n// Legacy naming for backward compatibility\nexport type ProductPurchaseAndroid = PurchaseCommon & {\n platform: 'android';\n /**\n * @deprecated Use `purchaseToken` instead. This field will be removed in a future version.\n */\n purchaseTokenAndroid?: string;\n dataAndroid?: string;\n signatureAndroid?: string;\n autoRenewingAndroid?: boolean;\n purchaseStateAndroid?: PurchaseAndroidState;\n isAcknowledgedAndroid?: boolean;\n packageNameAndroid?: string;\n developerPayloadAndroid?: string;\n obfuscatedAccountIdAndroid?: string;\n obfuscatedProfileIdAndroid?: string;\n};\n\n// Preferred naming\nexport type PurchaseAndroid = ProductPurchaseAndroid;\n\n// Removed legacy Android alias types in v2.9.0\n"]}
@@ -28,22 +28,6 @@ export type ProductIOS = ProductCommon & {
28
28
  jsonRepresentationIOS: string;
29
29
  platform: 'ios';
30
30
  subscriptionInfoIOS?: SubscriptionInfo;
31
- /**
32
- * @deprecated Use `displayNameIOS` instead. This field will be removed in v2.9.0.
33
- */
34
- displayName?: string;
35
- /**
36
- * @deprecated Use `isFamilyShareableIOS` instead. This field will be removed in v2.9.0.
37
- */
38
- isFamilyShareable?: boolean;
39
- /**
40
- * @deprecated Use `jsonRepresentationIOS` instead. This field will be removed in v2.9.0.
41
- */
42
- jsonRepresentation?: string;
43
- /**
44
- * @deprecated Use `subscriptionInfoIOS` instead. This field will be removed in v2.9.0.
45
- */
46
- subscription?: SubscriptionInfo;
47
31
  introductoryPriceNumberOfPeriodsIOS?: string;
48
32
  introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;
49
33
  };
@@ -66,14 +50,6 @@ export type ProductSubscriptionIOS = ProductIOS & {
66
50
  platform: 'ios';
67
51
  subscriptionPeriodNumberIOS?: string;
68
52
  subscriptionPeriodUnitIOS?: SubscriptionIosPeriod;
69
- /**
70
- * @deprecated Use `discountsIOS` instead. This field will be removed in v2.9.0.
71
- */
72
- discounts?: Discount[];
73
- /**
74
- * @deprecated Use `introductoryPriceIOS` instead. This field will be removed in v2.9.0.
75
- */
76
- introductoryPrice?: string;
77
53
  };
78
54
  export type SubscriptionProductIOS = ProductSubscriptionIOS;
79
55
  export type PaymentDiscount = {
@@ -108,14 +84,14 @@ export type RequestPurchaseIosProps = {
108
84
  quantity?: number;
109
85
  withOffer?: PaymentDiscount;
110
86
  };
111
- type SubscriptionStatus = 'expired' | 'inBillingRetryPeriod' | 'inGracePeriod' | 'revoked' | 'subscribed';
87
+ type SubscriptionState = 'expired' | 'inBillingRetryPeriod' | 'inGracePeriod' | 'revoked' | 'subscribed';
112
88
  type RenewalInfo = {
113
89
  jsonRepresentation?: string;
114
90
  willAutoRenew: boolean;
115
91
  autoRenewPreference?: string;
116
92
  };
117
- export type ProductStatusIOS = {
118
- state: SubscriptionStatus;
93
+ export type SubscriptionStatusIOS = {
94
+ state: SubscriptionState;
119
95
  renewalInfo?: RenewalInfo;
120
96
  };
121
97
  export type ProductPurchaseIOS = PurchaseCommon & {
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoIapIOS.types.d.ts","sourceRoot":"","sources":["../../src/types/ExpoIapIOS.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/D,KAAK,qBAAqB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,EAAE,CAAC;AACpE,KAAK,WAAW,GAAG,EAAE,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC;AAElE,KAAK,iBAAiB,GAAG;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE;QACN,IAAI,EAAE,qBAAqB,CAAC;QAC5B,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,cAAc,GAAG,aAAa,CAAC;CACtC,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACxC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE;QAClB,IAAI,EAAE,qBAAqB,CAAC;QAC5B,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,EAAE,KAAK,CAAC;IAChB,mBAAmB,CAAC,EAAE,gBAAgB,CAAC;IACvC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,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kBAAkB,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoIapIOS.types.js","sourceRoot":"","sources":["../../src/types/ExpoIapIOS.types.ts"],"names":[],"mappings":"","sourcesContent":["import {PurchaseCommon, ProductCommon} from '../ExpoIap.types';\n\ntype SubscriptionIosPeriod = 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | '';\ntype PaymentMode = '' | 'FREETRIAL' | 'PAYASYOUGO' | 'PAYUPFRONT';\n\ntype SubscriptionOffer = {\n displayPrice: string;\n id: string;\n paymentMode: PaymentMode;\n period: {\n unit: SubscriptionIosPeriod;\n value: number;\n };\n periodCount: number;\n price: number;\n type: 'introductory' | 'promotional';\n};\n\ntype SubscriptionInfo = {\n introductoryOffer?: SubscriptionOffer;\n promotionalOffers?: SubscriptionOffer[];\n subscriptionGroupId: string;\n subscriptionPeriod: {\n unit: SubscriptionIosPeriod;\n value: number;\n };\n};\n\nexport type ProductIOS = ProductCommon & {\n displayNameIOS: string;\n isFamilyShareableIOS: boolean;\n jsonRepresentationIOS: string;\n platform: 'ios';\n subscriptionInfoIOS?: SubscriptionInfo;\n /**\n * @deprecated Use `displayNameIOS` instead. This field will be removed in v2.9.0.\n */\n displayName?: string;\n /**\n * @deprecated Use `isFamilyShareableIOS` instead. This field will be removed in v2.9.0.\n */\n isFamilyShareable?: boolean;\n /**\n * @deprecated Use `jsonRepresentationIOS` instead. This field will be removed in v2.9.0.\n */\n jsonRepresentation?: string;\n /**\n * @deprecated Use `subscriptionInfoIOS` instead. This field will be removed in v2.9.0.\n */\n subscription?: SubscriptionInfo;\n introductoryPriceNumberOfPeriodsIOS?: string;\n introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;\n};\n\nexport type Discount = {\n identifier: string;\n type: string;\n numberOfPeriods: string;\n price: string;\n localizedPrice: string;\n paymentMode: PaymentMode;\n subscriptionPeriod: string;\n};\n\nexport type ProductSubscriptionIOS = ProductIOS & {\n discountsIOS?: Discount[];\n introductoryPriceIOS?: string;\n introductoryPriceAsAmountIOS?: string;\n introductoryPricePaymentModeIOS?: PaymentMode;\n introductoryPriceNumberOfPeriodsIOS?: string;\n introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;\n platform: 'ios';\n subscriptionPeriodNumberIOS?: string;\n subscriptionPeriodUnitIOS?: SubscriptionIosPeriod;\n /**\n * @deprecated Use `discountsIOS` instead. This field will be removed in v2.9.0.\n */\n discounts?: Discount[];\n /**\n * @deprecated Use `introductoryPriceIOS` instead. This field will be removed in v2.9.0.\n */\n introductoryPrice?: string;\n};\n\n// Legacy naming for backward compatibility\nexport type SubscriptionProductIOS = ProductSubscriptionIOS;\n\nexport type PaymentDiscount = {\n /**\n * A string used to uniquely identify a discount offer for a product.\n */\n identifier: string;\n /**\n * A string that identifies the key used to generate the signature.\n */\n keyIdentifier: string;\n /**\n * A universally unique ID (UUID) value that you define.\n */\n nonce: string;\n /**\n * A UTF-8 string representing the properties of a specific discount offer, cryptographically signed.\n */\n signature: string;\n /**\n * The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.\n */\n timestamp: number;\n};\n\nexport type RequestPurchaseIosProps = {\n sku: string;\n andDangerouslyFinishTransactionAutomatically?: boolean;\n /**\n * UUID representing user account\n */\n appAccountToken?: string;\n quantity?: number;\n withOffer?: PaymentDiscount;\n};\n\ntype SubscriptionStatus =\n | 'expired'\n | 'inBillingRetryPeriod'\n | 'inGracePeriod'\n | 'revoked'\n | 'subscribed';\n\ntype RenewalInfo = {\n jsonRepresentation?: string;\n willAutoRenew: boolean;\n autoRenewPreference?: string;\n};\n\nexport type ProductStatusIOS = {\n state: SubscriptionStatus;\n renewalInfo?: RenewalInfo;\n};\n\n// Legacy naming for backward compatibility\nexport type ProductPurchaseIOS = PurchaseCommon & {\n // iOS basic fields\n platform: 'ios';\n quantityIOS?: number;\n originalTransactionDateIOS?: number;\n originalTransactionIdentifierIOS?: string;\n appAccountToken?: string;\n // iOS additional fields from StoreKit 2\n expirationDateIOS?: number;\n webOrderLineItemIdIOS?: number;\n environmentIOS?: string;\n storefrontCountryCodeIOS?: string;\n appBundleIdIOS?: string;\n productTypeIOS?: string;\n subscriptionGroupIdIOS?: string;\n isUpgradedIOS?: boolean;\n ownershipTypeIOS?: string;\n reasonIOS?: string;\n reasonStringRepresentationIOS?: string;\n transactionReasonIOS?: 'PURCHASE' | 'RENEWAL' | string;\n revocationDateIOS?: number;\n revocationReasonIOS?: string;\n offerIOS?: {\n id: string;\n type: string;\n paymentMode: string;\n };\n // Price locale fields\n currencyCodeIOS?: string;\n currencySymbolIOS?: string;\n countryCodeIOS?: string;\n /**\n * @deprecated Use `purchaseToken` instead. This field will be removed in a future version.\n * iOS 15+ JWS representation is now available through the `purchaseToken` field.\n */\n jwsRepresentationIOS?: string;\n};\n\n// Preferred naming\nexport type PurchaseIOS = ProductPurchaseIOS;\n\nexport type AppTransactionIOS = {\n appTransactionId?: string; // Only available in iOS 18.4+\n originalPlatform?: string; // Only available in iOS 18.4+\n bundleId: string;\n appVersion: string;\n originalAppVersion: string;\n originalPurchaseDate: number;\n deviceVerification: string;\n deviceVerificationNonce: string;\n environment: string;\n signedDate: number;\n appId?: number;\n appVersionId?: number;\n preorderDate?: number;\n};\n"]}
1
+ {"version":3,"file":"ExpoIapIOS.types.js","sourceRoot":"","sources":["../../src/types/ExpoIapIOS.types.ts"],"names":[],"mappings":"","sourcesContent":["import {PurchaseCommon, ProductCommon} from '../ExpoIap.types';\n\ntype SubscriptionIosPeriod = 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | '';\ntype PaymentMode = '' | 'FREETRIAL' | 'PAYASYOUGO' | 'PAYUPFRONT';\n\ntype SubscriptionOffer = {\n displayPrice: string;\n id: string;\n paymentMode: PaymentMode;\n period: {\n unit: SubscriptionIosPeriod;\n value: number;\n };\n periodCount: number;\n price: number;\n type: 'introductory' | 'promotional';\n};\n\ntype SubscriptionInfo = {\n introductoryOffer?: SubscriptionOffer;\n promotionalOffers?: SubscriptionOffer[];\n subscriptionGroupId: string;\n subscriptionPeriod: {\n unit: SubscriptionIosPeriod;\n value: number;\n };\n};\n\nexport type ProductIOS = ProductCommon & {\n displayNameIOS: string;\n isFamilyShareableIOS: boolean;\n jsonRepresentationIOS: string;\n platform: 'ios';\n subscriptionInfoIOS?: SubscriptionInfo;\n introductoryPriceNumberOfPeriodsIOS?: string;\n introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;\n};\n\nexport type Discount = {\n identifier: string;\n type: string;\n numberOfPeriods: string;\n price: string;\n localizedPrice: string;\n paymentMode: PaymentMode;\n subscriptionPeriod: string;\n};\n\nexport type ProductSubscriptionIOS = ProductIOS & {\n discountsIOS?: Discount[];\n introductoryPriceIOS?: string;\n introductoryPriceAsAmountIOS?: string;\n introductoryPricePaymentModeIOS?: PaymentMode;\n introductoryPriceNumberOfPeriodsIOS?: string;\n introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;\n platform: 'ios';\n subscriptionPeriodNumberIOS?: string;\n subscriptionPeriodUnitIOS?: SubscriptionIosPeriod;\n};\n\n// Legacy naming for backward compatibility\nexport type SubscriptionProductIOS = ProductSubscriptionIOS;\n\nexport type PaymentDiscount = {\n /**\n * A string used to uniquely identify a discount offer for a product.\n */\n identifier: string;\n /**\n * A string that identifies the key used to generate the signature.\n */\n keyIdentifier: string;\n /**\n * A universally unique ID (UUID) value that you define.\n */\n nonce: string;\n /**\n * A UTF-8 string representing the properties of a specific discount offer, cryptographically signed.\n */\n signature: string;\n /**\n * The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.\n */\n timestamp: number;\n};\n\nexport type RequestPurchaseIosProps = {\n sku: string;\n andDangerouslyFinishTransactionAutomatically?: boolean;\n /**\n * UUID representing user account\n */\n appAccountToken?: string;\n quantity?: number;\n withOffer?: PaymentDiscount;\n};\n\ntype SubscriptionState =\n | 'expired'\n | 'inBillingRetryPeriod'\n | 'inGracePeriod'\n | 'revoked'\n | 'subscribed';\n\ntype RenewalInfo = {\n jsonRepresentation?: string;\n willAutoRenew: boolean;\n autoRenewPreference?: string;\n};\n\nexport type SubscriptionStatusIOS = {\n state: SubscriptionState;\n renewalInfo?: RenewalInfo;\n};\n\n// Legacy naming for backward compatibility\nexport type ProductPurchaseIOS = PurchaseCommon & {\n // iOS basic fields\n platform: 'ios';\n quantityIOS?: number;\n originalTransactionDateIOS?: number;\n originalTransactionIdentifierIOS?: string;\n appAccountToken?: string;\n // iOS additional fields from StoreKit 2\n expirationDateIOS?: number;\n webOrderLineItemIdIOS?: number;\n environmentIOS?: string;\n storefrontCountryCodeIOS?: string;\n appBundleIdIOS?: string;\n productTypeIOS?: string;\n subscriptionGroupIdIOS?: string;\n isUpgradedIOS?: boolean;\n ownershipTypeIOS?: string;\n reasonIOS?: string;\n reasonStringRepresentationIOS?: string;\n transactionReasonIOS?: 'PURCHASE' | 'RENEWAL' | string;\n revocationDateIOS?: number;\n revocationReasonIOS?: string;\n offerIOS?: {\n id: string;\n type: string;\n paymentMode: string;\n };\n // Price locale fields\n currencyCodeIOS?: string;\n currencySymbolIOS?: string;\n countryCodeIOS?: string;\n /**\n * @deprecated Use `purchaseToken` instead. This field will be removed in a future version.\n * iOS 15+ JWS representation is now available through the `purchaseToken` field.\n */\n jwsRepresentationIOS?: string;\n};\n\n// Preferred naming\nexport type PurchaseIOS = ProductPurchaseIOS;\n\nexport type AppTransactionIOS = {\n appTransactionId?: string; // Only available in iOS 18.4+\n originalPlatform?: string; // Only available in iOS 18.4+\n bundleId: string;\n appVersion: string;\n originalAppVersion: string;\n originalPurchaseDate: number;\n deviceVerification: string;\n deviceVerificationNonce: string;\n environment: string;\n signedDate: number;\n appId?: number;\n appVersionId?: number;\n preorderDate?: number;\n};\n"]}