expo-iap 4.5.0 → 4.5.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.
- package/android/src/main/java/expo/modules/iap/ExpoIapLog.kt +1 -0
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +13 -1
- package/build/index.js.map +1 -1
- package/build/index.kepler.d.ts +1 -0
- package/build/index.kepler.d.ts.map +1 -1
- package/build/index.kepler.js.map +1 -1
- package/build/kit-api.d.ts +60 -0
- package/build/kit-api.d.ts.map +1 -1
- package/build/kit-api.js +28 -0
- package/build/kit-api.js.map +1 -1
- package/build/types.d.ts +36 -1
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/build/vega-adapter.d.ts.map +1 -1
- package/build/vega-adapter.js +7 -5
- package/build/vega-adapter.js.map +1 -1
- package/ios/ExpoIapLog.swift +1 -0
- package/openiap-versions.json +3 -3
- package/package.json +1 -1
- package/plugin/build/withIAP.js +5 -2
- package/plugin/src/withIAP.ts +5 -2
- package/src/index.kepler.ts +13 -0
- package/src/index.ts +23 -1
- package/src/kit-api.ts +107 -0
- package/src/types.ts +38 -1
- package/src/vega-adapter.ts +13 -9
package/build/index.d.ts
CHANGED
|
@@ -433,7 +433,7 @@ export type { UseWebhookEventsOptions, UseWebhookEventsResult, } from './useWebh
|
|
|
433
433
|
export { connectWebhookStream, parseWebhookEventData } from './webhook-client';
|
|
434
434
|
export type { WebhookEventPayload, WebhookEventStream, WebhookEventType as WebhookEventTypeName, WebhookListener, WebhookListenerError, WebhookListenerOptions, } from './webhook-client';
|
|
435
435
|
export { kitApi, KitApiError } from './kit-api';
|
|
436
|
-
export type { KitApiOptions, KitSubscription, EntitlementsResponse, StatusResponse, } from './kit-api';
|
|
436
|
+
export type { KitApiOptions, KitClientPayloadResponse, KitProduct, KitProductClientPayload, KitProductOffer, KitProductPlatform, KitProductsOptions, KitProductsResponse, KitSubscription, EntitlementsResponse, StatusResponse, } from './kit-api';
|
|
437
437
|
export { ErrorCodeUtils, ErrorCodeMapping, createPurchaseError, createPurchaseErrorFromPlatform, } from './utils/errorMapping';
|
|
438
438
|
export type { PurchaseError as ExpoPurchaseError, PurchaseErrorProps, } from './utils/errorMapping';
|
|
439
439
|
export { ExpoIapConsole } from './utils/debug';
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAIV,sCAAsC,EAEtC,aAAa,EAGb,OAAO,EACP,gBAAgB,EAEhB,QAAQ,EAER,8BAA8B,EAC9B,UAAU,EAOV,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAIL,KAAK,aAAa,EAEnB,MAAM,sBAAsB,CAAC;AAG9B,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAGvB,oBAAY,YAAY;IACtB,eAAe,qBAAqB;IACpC,aAAa,mBAAmB;IAChC,kBAAkB,yBAAyB;IAC3C,wBAAwB,gCAAgC;IACxD;;;OAGG;IACH,+BAA+B,uCAAuC;IACtE;;;;OAIG;IACH,wBAAwB,+BAA+B;CACxD;AAED,KAAK,oBAAoB,GAAG;IAC1B,CAAC,YAAY,CAAC,eAAe,CAAC,EAAE,QAAQ,CAAC;IACzC,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC5C,CAAC,YAAY,CAAC,kBAAkB,CAAC,EAC7B,OAAO,GACP,MAAM,GACN;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IACtC,CAAC,YAAY,CAAC,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IAClE,CAAC,YAAY,CAAC,+BAA+B,CAAC,EA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,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -1035,7 +1035,19 @@ export const verifyPurchaseWithProvider = async (options) => {
|
|
|
1035
1035
|
'Or provide apiKey directly in verifyPurchaseWithProvider options.');
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
|
-
|
|
1038
|
+
const result = await ExpoIapModule.verifyPurchaseWithProvider(resolvedOptions);
|
|
1039
|
+
if (result.iapkit == null) {
|
|
1040
|
+
return result;
|
|
1041
|
+
}
|
|
1042
|
+
const { clientPayload, productId, ...iapkit } = result.iapkit;
|
|
1043
|
+
return {
|
|
1044
|
+
...result,
|
|
1045
|
+
iapkit: {
|
|
1046
|
+
...iapkit,
|
|
1047
|
+
...(clientPayload == null ? {} : { clientPayload }),
|
|
1048
|
+
...(productId == null ? {} : { productId }),
|
|
1049
|
+
},
|
|
1050
|
+
};
|
|
1039
1051
|
};
|
|
1040
1052
|
export * from './useIAP';
|
|
1041
1053
|
export { useWebhookEvents } from './useWebhookEvents';
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAEtC,mBAAmB;AACnB,OAAO,aAAa,EAAE,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAChC,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;AAC3B,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AA2B7C,OAAO,EAAC,SAAS,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gB,EAAC,MAAM,oBAAoB,CAAC;AAKpD,OAAO,EAAC,oBAAoB,EAAE,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAS7E,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,WAAW,CAAC;AAO9C,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC","sourcesContent":["// External dependencies\nimport {Platform} from 'react-native';\n\n// Internal modules\nimport ExpoIapModule, {getNativeModule} from './ExpoIapModule';\nimport {isVegaOS} from './vega';\nimport {\n isProductIOS,\n validateReceiptIOS,\n deepLinkToSubscriptionsIOS,\n syncIOS,\n} from './modules/ios';\nimport {\n isProductAndroid,\n validateReceiptAndroid,\n deepLinkToSubscriptionsAndroid,\n} from './modules/android';\nimport {ExpoIapConsole} from './utils/debug';\n\n// Types\nimport type {\n ActiveSubscription,\n AndroidSubscriptionOfferInput,\n DeepLinkOptions,\n DeveloperProvidedBillingDetailsAndroid,\n IapPlatform,\n MutationField,\n MutationRequestPurchaseArgs,\n MutationValidateReceiptArgs,\n Product,\n ProductQueryType,\n ProductSubscription,\n Purchase,\n PurchaseOptions,\n PurchaseUpdatedListenerOptions,\n QueryField,\n RequestPurchasePropsByPlatforms,\n RequestPurchaseAndroidProps,\n RequestPurchaseIosProps,\n RequestSubscriptionPropsByPlatforms,\n RequestSubscriptionAndroidProps,\n RequestSubscriptionIosProps,\n UserChoiceBillingDetails,\n} from './types';\nimport {ErrorCode} from './types';\nimport {\n createPurchaseError,\n createPurchaseErrorFromNativeException,\n OPENIAP_ERROR_ENVELOPE_PREFIX,\n type PurchaseError,\n type PurchaseErrorProps,\n} from './utils/errorMapping';\n\n// Export all types\nexport * from './types';\nexport * from './modules/android';\nexport * from './modules/ios';\nexport * from './onside';\nexport * from './vega';\n\n// Get the native constant value\nexport enum OpenIapEvent {\n PurchaseUpdated = 'purchase-updated',\n PurchaseError = 'purchase-error',\n PromotedProductIOS = 'promoted-product-ios',\n UserChoiceBillingAndroid = 'user-choice-billing-android',\n /**\n * Fired for External Payments (8.3.0+) and Billing Choice (9.1.0+)\n * developer billing flows. Nullable fields depend on the selected flow.\n */\n DeveloperProvidedBillingAndroid = 'developer-provided-billing-android',\n /**\n * Fired when a subscription enters a billing-issue state (cross-platform).\n * Unifies StoreKit 2 `Message.Reason.billingIssue` (iOS / Mac Catalyst 16.4+, visionOS 1.0+) and Play Billing 8.1+\n * `Purchase.isSuspended`. NOT fired on the Meta Horizon flavor.\n */\n SubscriptionBillingIssue = 'subscription-billing-issue',\n}\n\ntype ExpoIapEventPayloads = {\n [OpenIapEvent.PurchaseUpdated]: Purchase;\n [OpenIapEvent.PurchaseError]: PurchaseError;\n [OpenIapEvent.PromotedProductIOS]:\n | Product\n | string\n | {id?: string; productId?: string};\n [OpenIapEvent.UserChoiceBillingAndroid]: UserChoiceBillingDetails;\n [OpenIapEvent.DeveloperProvidedBillingAndroid]: DeveloperProvidedBillingDetailsAndroid;\n [OpenIapEvent.SubscriptionBillingIssue]: Purchase;\n};\n\ntype ExpoIapEventListener<E extends OpenIapEvent> = (\n payload: ExpoIapEventPayloads[E],\n) => void;\n\ntype ExpoIapEmitter = {\n addListener<E extends OpenIapEvent>(\n eventName: E,\n listener: ExpoIapEventListener<E>,\n ): {remove: () => void};\n removeListener<E extends OpenIapEvent>(\n eventName: E,\n listener: ExpoIapEventListener<E>,\n ): void;\n};\n\ntype NativePurchaseUpdatedOptionsModule = {\n setPurchaseUpdatedListenerOptions?: (\n options?: PurchaseUpdatedListenerOptions | null,\n ) => Promise<void>;\n};\n\nconst isStorePlatform = (): boolean =>\n Platform.OS === 'ios' || Platform.OS === 'android';\n\nconst isStoreRuntime = (): boolean =>\n Platform.OS === 'ios' || isAndroidStoreRuntime();\n\nconst unsupportedPlatformError = (): Error =>\n new Error(`Unsupported platform: ${Platform.OS}`);\n\n// Use the raw native module for listener calls — JSI HostObjects require the\n// real native module as `this` when calling addListener. Using a Proxy as\n// `this` triggers \"native state unsupported on Proxy\" on New Architecture / Hermes.\n// Resolved lazily so importing this module doesn't throw on unsupported platforms.\nexport const emitter: ExpoIapEmitter = {\n addListener(eventName, listener) {\n const nativeModule = getNativeModule();\n const nativeSubscription = nativeModule.addListener(eventName, listener);\n let removed = false;\n\n return {\n remove: () => {\n if (removed) {\n return;\n }\n removed = true;\n\n if (typeof nativeSubscription?.remove === 'function') {\n nativeSubscription.remove();\n return;\n }\n\n nativeModule.removeListener?.(eventName, listener);\n },\n };\n },\n removeListener(eventName, listener) {\n return getNativeModule().removeListener?.(eventName, listener);\n },\n};\n\nlet nonDedupingPurchaseUpdatedListenerCountIOS = 0;\nconst purchaseUpdatedDedupeHistoryLimitIOS = 512;\nconst purchaseUpdatedDedupeHistoryIOS = {\n ids: new Set<string>(),\n order: [] as string[],\n start: 0,\n};\nlet purchaseUpdatedDedupeGenerationIOS = 0;\n\ntype PurchaseUpdatedDedupeHistoryIOS = {\n ids: Set<string>;\n order: string[];\n start: number;\n};\n\nconst purchaseUpdatedTransactionIdIOS = (purchase: Purchase) => {\n if (typeof purchase.id === 'string' && purchase.id.length > 0) {\n return purchase.id;\n }\n return null;\n};\n\nconst rememberPurchaseUpdatedTransactionIOS = (\n transactionId: string,\n history: PurchaseUpdatedDedupeHistoryIOS,\n) => {\n if (history.ids.has(transactionId)) {\n return;\n }\n\n history.ids.add(transactionId);\n history.order.push(transactionId);\n if (\n history.order.length - history.start >\n purchaseUpdatedDedupeHistoryLimitIOS\n ) {\n const evicted = history.order[history.start];\n history.start += 1;\n if (evicted != null) {\n history.ids.delete(evicted);\n }\n if (history.start > 128 && history.start * 2 > history.order.length) {\n history.order = history.order.slice(history.start);\n history.start = 0;\n }\n }\n};\n\nconst clearPurchaseUpdatedDedupeHistoryIOS = (\n history: PurchaseUpdatedDedupeHistoryIOS,\n) => {\n history.ids.clear();\n history.order.length = 0;\n history.start = 0;\n};\n\nconst resetPurchaseUpdatedDedupeHistoryIOS = () => {\n clearPurchaseUpdatedDedupeHistoryIOS(purchaseUpdatedDedupeHistoryIOS);\n purchaseUpdatedDedupeGenerationIOS += 1;\n};\n\nconst configurePurchaseUpdatedListenerOptionsIOS = (\n dedupeTransactionIOS: boolean,\n) => {\n if (Platform.OS !== 'ios') return;\n\n const nativeModule = getNativeModule() as NativePurchaseUpdatedOptionsModule;\n const promise = nativeModule.setPurchaseUpdatedListenerOptions?.({\n dedupeTransactionIOS,\n });\n void promise?.catch((error: unknown) => {\n ExpoIapConsole.warn(\n 'Failed to configure purchase updated listener options:',\n error,\n );\n });\n};\n\n/**\n * TODO(next-major): Remove legacy 'inapp' alias once downstream apps migrate to 'in-app'.\n */\nexport type ProductTypeInput = ProductQueryType | 'inapp';\n\nconst normalizeProductType = (type?: ProductTypeInput) => {\n if (type === 'inapp') {\n ExpoIapConsole.warn(\n \"'inapp' product type is deprecated and will be removed in a future major version. Use 'in-app' instead.\",\n );\n }\n\n if (!type || type === 'inapp' || type === 'in-app') {\n return {\n canonical: 'in-app' as ProductQueryType,\n native: 'in-app' as const,\n };\n }\n if (type === 'subs') {\n return {\n canonical: 'subs' as ProductQueryType,\n native: 'subs' as const,\n };\n }\n if (type === 'all') {\n return {\n canonical: 'all' as ProductQueryType,\n native: 'all' as const,\n };\n }\n throw new Error(`Unsupported product type: ${type}`);\n};\n\nconst normalizePurchasePlatform = (purchase: Purchase): Purchase => {\n const platform = purchase.platform;\n if (typeof platform !== 'string') {\n return purchase;\n }\n\n const lowered = platform.toLowerCase();\n if (lowered === platform || (lowered !== 'ios' && lowered !== 'android')) {\n return purchase;\n }\n\n return {...purchase, platform: lowered};\n};\n\nconst normalizePurchaseArray = (purchases: Purchase[]): Purchase[] =>\n purchases.map((purchase) => normalizePurchasePlatform(purchase));\n\nconst isAndroidStoreRuntime = (): boolean => {\n return Platform.OS === 'android' || isVegaOS();\n};\n\nexport const purchaseUpdatedListener = (\n listener: (event: Purchase) => void,\n options?: PurchaseUpdatedListenerOptions | null,\n) => {\n const receiveDuplicateTransactionUpdatesIOS =\n Platform.OS === 'ios' && options?.dedupeTransactionIOS === false;\n const listenerDedupeHistoryIOS: PurchaseUpdatedDedupeHistoryIOS = {\n ids: new Set(purchaseUpdatedDedupeHistoryIOS.ids),\n order: purchaseUpdatedDedupeHistoryIOS.order.slice(\n purchaseUpdatedDedupeHistoryIOS.start,\n ),\n start: 0,\n };\n let listenerDedupeGenerationIOS = purchaseUpdatedDedupeGenerationIOS;\n\n const wrappedListener = (event: Purchase) => {\n const normalized = normalizePurchasePlatform(event);\n if (Platform.OS === 'ios') {\n if (listenerDedupeGenerationIOS !== purchaseUpdatedDedupeGenerationIOS) {\n clearPurchaseUpdatedDedupeHistoryIOS(listenerDedupeHistoryIOS);\n listenerDedupeGenerationIOS = purchaseUpdatedDedupeGenerationIOS;\n }\n const transactionId = purchaseUpdatedTransactionIdIOS(normalized);\n if (transactionId != null) {\n const isDuplicateForListener =\n listenerDedupeHistoryIOS.ids.has(transactionId);\n rememberPurchaseUpdatedTransactionIOS(\n transactionId,\n listenerDedupeHistoryIOS,\n );\n rememberPurchaseUpdatedTransactionIOS(\n transactionId,\n purchaseUpdatedDedupeHistoryIOS,\n );\n if (!receiveDuplicateTransactionUpdatesIOS && isDuplicateForListener) {\n return;\n }\n }\n }\n listener(normalized);\n };\n const emitterSubscription = emitter.addListener(\n OpenIapEvent.PurchaseUpdated,\n wrappedListener,\n );\n\n if (!receiveDuplicateTransactionUpdatesIOS) {\n return emitterSubscription;\n }\n\n nonDedupingPurchaseUpdatedListenerCountIOS += 1;\n configurePurchaseUpdatedListenerOptionsIOS(false);\n let removed = false;\n\n return {\n remove: () => {\n if (removed) {\n return;\n }\n removed = true;\n try {\n emitterSubscription?.remove?.();\n } finally {\n nonDedupingPurchaseUpdatedListenerCountIOS = Math.max(\n 0,\n nonDedupingPurchaseUpdatedListenerCountIOS - 1,\n );\n configurePurchaseUpdatedListenerOptionsIOS(\n nonDedupingPurchaseUpdatedListenerCountIOS === 0,\n );\n }\n },\n };\n};\n\nexport const purchaseErrorListener = (\n listener: (error: PurchaseError) => void,\n) => {\n const wrappedListener = (error: PurchaseError) => {\n listener(error);\n };\n const emitterSubscription = emitter.addListener(\n OpenIapEvent.PurchaseError,\n wrappedListener,\n );\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 ExpoIapConsole.warn(\n 'promotedProductListenerIOS: This listener is only available on iOS',\n );\n return {remove: () => {}};\n }\n\n let deliveredProductId: string | undefined;\n const deliver = (product: Product) => {\n const productId =\n product.id ?? (product as Product & {productId?: string}).productId;\n if (productId && productId === deliveredProductId) {\n return;\n }\n deliveredProductId = productId;\n listener(product);\n };\n\n const replayPendingProduct = () => {\n let pendingProduct: Promise<Product | null> | undefined;\n try {\n pendingProduct = ExpoIapModule.getPromotedProductIOS() as\n | Promise<Product | null>\n | undefined;\n } catch {\n return Promise.resolve();\n }\n\n if (!pendingProduct || typeof pendingProduct.then !== 'function') {\n return Promise.resolve();\n }\n\n return pendingProduct\n .then((product: Product | null) => {\n if (product) {\n deliver(product);\n }\n })\n .catch(() => {});\n };\n\n const subscription = emitter.addListener(\n OpenIapEvent.PromotedProductIOS,\n (payload) => {\n if (typeof payload === 'string') {\n void replayPendingProduct();\n return;\n }\n\n deliver(payload as Product);\n },\n );\n\n void replayPendingProduct();\n\n return subscription;\n};\n\n/**\n * Android-only listener for User Choice Billing events.\n * This fires when a user selects alternative billing instead of Google Play billing\n * in the User Choice Billing dialog (only in 'user-choice' mode).\n *\n * @param listener - Callback function that receives the external transaction token and product IDs\n * @returns EventSubscription that can be used to unsubscribe\n *\n * @example\n * ```typescript\n * const subscription = userChoiceBillingListenerAndroid((details) => {\n * console.log('User selected alternative billing');\n * console.log('External transaction token received; send it to your backend without logging it.');\n * console.log('Products:', details.products);\n *\n * // Process payment in your system, then report token to Google\n * await processPaymentAndReportToken(details);\n * });\n *\n * // Later, clean up\n * subscription.remove();\n * ```\n *\n * @platform Android\n */\nexport const userChoiceBillingListenerAndroid = (\n listener: (details: UserChoiceBillingDetails) => void,\n) => {\n if (Platform.OS !== 'android') {\n ExpoIapConsole.warn(\n 'userChoiceBillingListenerAndroid: This listener is only available on Android',\n );\n return {remove: () => {}};\n }\n return emitter.addListener(OpenIapEvent.UserChoiceBillingAndroid, listener);\n};\n\n/**\n * Android-only listener for Developer Provided Billing events.\n * This fires when a user selects the developer's option in an External Payments\n * or Billing Choice purchase flow.\n *\n * Requires Google Play Billing Library 8.3.0+; Billing Choice fields require 9.1.0+.\n *\n * @param listener - Callback that receives selected products and flow details\n * @returns EventSubscription that can be used to unsubscribe\n *\n * @example\n * ```typescript\n * const subscription = developerProvidedBillingListenerAndroid(async (details) => {\n * await processPaymentWithYourGateway(details.products, details.linkUri);\n * if (details.externalTransactionToken) {\n * await reportExternalTransactionToGoogle(details.externalTransactionToken);\n * }\n * });\n *\n * // Later, clean up\n * subscription.remove();\n * ```\n *\n * @platform Android (8.3.0+; Billing Choice 9.1.0+)\n */\nexport const developerProvidedBillingListenerAndroid = (\n listener: (details: DeveloperProvidedBillingDetailsAndroid) => void,\n) => {\n if (Platform.OS !== 'android') {\n ExpoIapConsole.warn(\n 'developerProvidedBillingListenerAndroid: This listener is only available on Android',\n );\n return {remove: () => {}};\n }\n return emitter.addListener(\n OpenIapEvent.DeveloperProvidedBillingAndroid,\n listener,\n );\n};\n\n/**\n * Listen for subscription billing-issue events (cross-platform).\n *\n * Fires when a user's active subscription enters a state that needs attention\n * for a payment problem. Unifies:\n * - iOS / Mac Catalyst 16.4+ and visionOS 1.0+: StoreKit 2 `Message.Reason.billingIssue`.\n * - Android (Play Billing 8.1+): when `Purchase.isSuspendedAndroid === true`.\n * - Meta Horizon / iOS 17 / older platforms: never fires.\n *\n * Recommended UX: call `deepLinkToSubscriptions()` when this fires so the user\n * can update their payment method in the platform subscription center.\n *\n * @example\n * ```typescript\n * const subscription = subscriptionBillingIssueListener((purchase) => {\n * console.warn('Needs attention:', purchase.productId);\n * deepLinkToSubscriptions({\n * skuAndroid: purchase.productId,\n * packageNameAndroid: 'com.example.app',\n * });\n * });\n * ```\n */\nexport const subscriptionBillingIssueListener = (\n listener: (purchase: Purchase) => void,\n) => {\n // Mirror purchaseUpdatedListener's platform normalization so consumers get\n // a consistent payload regardless of native casing.\n const wrappedListener = (event: Purchase) => {\n listener(normalizePurchasePlatform(event));\n };\n return emitter.addListener(\n OpenIapEvent.SubscriptionBillingIssue,\n wrappedListener,\n );\n};\n\n/**\n * Initialize the store connection. Must be called before any other IAP API.\n *\n * @param config Optional connection config. Use `enableBillingProgramAndroid` (Android,\n * Play Billing 8.2.0+) to opt into a billing program. For Billing Choice 9.1.0+, set\n * `billingChoiceScreenTypeAndroid` to the renderer configured in Play Console.\n * iOS ignores Android-specific fields.\n * @returns Promise resolving to `true` when the platform billing client is connected.\n * @throws When the platform billing client fails to initialize.\n *\n * @example\n * ```ts\n * await initConnection();\n * await initConnection({ enableBillingProgramAndroid: 'external-offer' });\n * await initConnection({\n * enableBillingProgramAndroid: 'billing-choice',\n * billingChoiceScreenTypeAndroid: 'developer-rendered',\n * });\n * ```\n *\n * @remarks When using `useIAP()`, connection is auto-managed on mount/unmount —\n * pass options to the hook instead of calling this directly.\n *\n * @see {@link https://openiap.dev/docs/apis/init-connection}\n */\nexport const initConnection: MutationField<'initConnection'> = async (\n config,\n) => {\n const result = await ExpoIapModule.initConnection(config ?? null);\n if (\n result === true &&\n Platform.OS === 'ios' &&\n nonDedupingPurchaseUpdatedListenerCountIOS > 0\n ) {\n configurePurchaseUpdatedListenerOptionsIOS(false);\n }\n return result;\n};\n\n/**\n * Close the store connection and release resources.\n *\n * @see {@link https://openiap.dev/docs/apis/end-connection}\n */\nexport const endConnection: MutationField<'endConnection'> = async () => {\n const result = await ExpoIapModule.endConnection();\n if (result === true && Platform.OS === 'ios') {\n resetPurchaseUpdatedDedupeHistoryIOS();\n }\n return result;\n};\n\nconst invokeNativeWithPurchaseError = async <T>(\n operation: () => Promise<T>,\n platform: IapPlatform,\n fallback: PurchaseErrorProps,\n): Promise<T> => {\n try {\n return await operation();\n } catch (error) {\n const nativeError =\n typeof error === 'object' && error !== null\n ? (error as Record<string, unknown>)\n : undefined;\n const nativeMessage =\n typeof nativeError?.message === 'string'\n ? nativeError.message\n : typeof error === 'string'\n ? error\n : '';\n const hasCanonicalFields =\n nativeMessage.includes(OPENIAP_ERROR_ENVELOPE_PREFIX) ||\n nativeError?.code !== undefined ||\n nativeError?.responseCode !== undefined ||\n nativeError?.debugMessage !== undefined ||\n nativeError?.productId !== undefined ||\n nativeError?.productIds !== undefined;\n\n // Preserve the identity of unrelated JavaScript errors (including adapter\n // or test errors) while normalizing native OpenIAP rejections.\n if (!hasCanonicalFields) throw error;\n throw createPurchaseErrorFromNativeException(error, platform, fallback);\n }\n};\n\n/**\n * Retrieve products or subscriptions from the store by SKU.\n *\n * @param request `ProductRequest` — `skus` (string[]) and optional `type`\n * (`'in-app' | 'subs' | 'all'`, defaults to `'in-app'`).\n * @returns Promise resolving to a `FetchProductsResult` union — `Product[]` for `'in-app'`,\n * `ProductSubscription[]` for `'subs'`, or a mixed array for `'all'`.\n * @throws When the store rejects the request (empty `skus`, not connected,\n * network/store error). Unknown SKUs are simply omitted from the result, not thrown.\n *\n * @example\n * ```ts\n * const products = await fetchProducts({\n * skus: ['com.app.coins_100', 'com.app.premium'],\n * type: 'in-app',\n * });\n * ```\n *\n * @remarks This is a regular promise-based call. Don't confuse with `request*` APIs\n * (`requestPurchase`), which are event-based.\n *\n * @see {@link https://openiap.dev/docs/apis/fetch-products}\n */\nexport const fetchProducts: QueryField<'fetchProducts'> = async (request) => {\n ExpoIapConsole.debug('fetchProducts called with:', request);\n const {skus, type} = request ?? {};\n\n if (!Array.isArray(skus) || skus.length === 0) {\n throw createPurchaseError({\n message: 'No SKUs provided',\n code: ErrorCode.EmptySkuList,\n });\n }\n\n const {canonical, native} = normalizeProductType(\n type as ProductTypeInput | undefined,\n );\n const skuSet = new Set(skus);\n\n const filterIosItems = (\n items: unknown[],\n ): (Product | ProductSubscription)[] =>\n items.filter((item): item is Product | ProductSubscription => {\n if (!isProductIOS(item)) {\n return false;\n }\n const candidate = item as Product | ProductSubscription;\n return typeof candidate.id === 'string' && skuSet.has(candidate.id);\n });\n\n const filterAndroidItems = (\n items: unknown[],\n ): (Product | ProductSubscription)[] =>\n items.filter((item): item is Product | ProductSubscription => {\n if (!isProductAndroid(item)) {\n return false;\n }\n const candidate = item as Product | ProductSubscription;\n return typeof candidate.id === 'string' && skuSet.has(candidate.id);\n });\n\n const castResult = (\n items: (Product | ProductSubscription)[],\n ):\n | (Product | ProductSubscription)[]\n | Product[]\n | ProductSubscription[]\n | null => {\n if (canonical === 'in-app') {\n return items as Product[];\n }\n if (canonical === 'subs') {\n return items as ProductSubscription[];\n }\n // For 'all' type, items contain both Product and ProductSubscription\n // Return as ProductOrSubscription[] to preserve discriminated union\n return items;\n };\n\n if (Platform.OS === 'ios') {\n const rawItems = await invokeNativeWithPurchaseError<unknown[]>(\n () => ExpoIapModule.fetchProducts({skus, type: native}),\n 'ios',\n {\n code: ErrorCode.QueryProduct,\n message: 'Failed to query products',\n productIds: skus,\n productType: canonical,\n },\n );\n return castResult(filterIosItems(rawItems));\n }\n\n if (isAndroidStoreRuntime()) {\n const rawItems = await invokeNativeWithPurchaseError<unknown[]>(\n () => ExpoIapModule.fetchProducts(native, skus),\n 'android',\n {\n code: ErrorCode.QueryProduct,\n message: 'Failed to query products',\n productIds: skus,\n productType: canonical,\n },\n );\n return castResult(filterAndroidItems(rawItems));\n }\n\n throw unsupportedPlatformError();\n};\n\n/**\n * List the user's unfinished purchases — non-consumables, active subscriptions, and any\n * pending transactions not yet finished.\n *\n * @param options Optional `PurchaseOptions`. iOS-only flags:\n * `alsoPublishToEventListenerIOS`, `onlyIncludeActiveItemsIOS`.\n * @returns Promise resolving to an array of `Purchase` currently held by the store.\n * @throws When the platform query fails.\n *\n * @example\n * ```ts\n * const purchases = await getAvailablePurchases();\n * for (const p of purchases) {\n * if (await verifyOnServer(p)) await finishTransaction({ purchase: p, isConsumable: false });\n * }\n * ```\n *\n * @see {@link https://openiap.dev/docs/apis/get-available-purchases}\n */\nexport const getAvailablePurchases: QueryField<\n 'getAvailablePurchases'\n> = async (options) => {\n const normalizedOptions: PurchaseOptions = {\n alsoPublishToEventListenerIOS:\n options?.alsoPublishToEventListenerIOS ?? false,\n onlyIncludeActiveItemsIOS: options?.onlyIncludeActiveItemsIOS ?? true,\n includeSuspendedAndroid: options?.includeSuspendedAndroid ?? false,\n };\n\n if (isVegaOS()) {\n const purchases = await ExpoIapModule.getAvailableItems(normalizedOptions);\n return normalizePurchaseArray(purchases as Purchase[]);\n }\n\n let purchases: Purchase[];\n\n if (Platform.OS === 'ios') {\n purchases = (await ExpoIapModule.getAvailableItems(\n normalizedOptions.alsoPublishToEventListenerIOS,\n normalizedOptions.onlyIncludeActiveItemsIOS,\n )) as Purchase[];\n } else if (Platform.OS === 'android') {\n purchases = (await ExpoIapModule.getAvailableItems(\n normalizedOptions,\n )) as Purchase[];\n } else {\n throw unsupportedPlatformError();\n }\n\n return normalizePurchaseArray(purchases as Purchase[]);\n};\n\n/**\n * Get all active subscriptions with detailed information.\n * Uses native OpenIAP module for accurate subscription status and renewal info.\n *\n * On iOS: Returns subscriptions with renewalInfoIOS containing pendingUpgradeProductId,\n * willAutoRenew, autoRenewPreference, and other renewal details.\n *\n * On Android: Filters available purchases to find active subscriptions (fallback implementation).\n *\n * @param subscriptionIds - Optional array of subscription product IDs to filter. If not provided, returns all active subscriptions.\n * @returns Promise resolving to array of active subscriptions with details\n *\n * @example\n * ```typescript\n * // Get all active subscriptions\n * const subs = await getActiveSubscriptions();\n *\n * // Get specific subscriptions\n * const premiumSubs = await getActiveSubscriptions(['premium', 'premium_year']);\n *\n * // Check for pending upgrades (iOS)\n * subs.forEach(sub => {\n * if (sub.renewalInfoIOS?.pendingUpgradeProductId) {\n * console.log(`Upgrade pending to: ${sub.renewalInfoIOS.pendingUpgradeProductId}`);\n * }\n * });\n * ```\n *\n * @see {@link https://openiap.dev/docs/apis/get-active-subscriptions}\n */\nexport const getActiveSubscriptions: QueryField<\n 'getActiveSubscriptions'\n> = async (subscriptionIds) => {\n if (!isStoreRuntime()) {\n throw unsupportedPlatformError();\n }\n\n const result = await ExpoIapModule.getActiveSubscriptions(\n subscriptionIds ?? null,\n );\n return (result ?? []) as ActiveSubscription[];\n};\n\n/**\n * Check if user has any active subscriptions.\n *\n * @param subscriptionIds - Optional array of subscription product IDs to check. If not provided, checks all subscriptions.\n * @returns Promise resolving to true if user has at least one active subscription\n *\n * @example\n * ```typescript\n * // Check any active subscription\n * const hasAny = await hasActiveSubscriptions();\n *\n * // Check specific subscriptions\n * const hasPremium = await hasActiveSubscriptions(['premium', 'premium_year']);\n * ```\n *\n * @see {@link https://openiap.dev/docs/apis/has-active-subscriptions}\n */\nexport const hasActiveSubscriptions: QueryField<\n 'hasActiveSubscriptions'\n> = async (subscriptionIds) => {\n if (!isStoreRuntime()) {\n throw unsupportedPlatformError();\n }\n\n return !!(await ExpoIapModule.hasActiveSubscriptions(\n subscriptionIds ?? null,\n ));\n};\n\n/**\n * Return the user's storefront country code.\n *\n * @see {@link https://openiap.dev/docs/apis/get-storefront}\n */\nexport const getStorefront: QueryField<'getStorefront'> = async () => {\n if (Platform.OS !== 'ios' && !isAndroidStoreRuntime()) {\n throw createPurchaseError({\n code: ErrorCode.FeatureNotSupported,\n message: `Storefront lookup is not supported on ${Platform.OS}.`,\n });\n }\n\n const platform: IapPlatform = Platform.OS === 'ios' ? 'ios' : 'android';\n if (typeof ExpoIapModule.getStorefront !== 'function') {\n throw createPurchaseError({\n code: ErrorCode.FeatureNotSupported,\n message: 'Native getStorefront is not available on this build.',\n platform,\n });\n }\n\n let storefront: unknown;\n try {\n storefront = await ExpoIapModule.getStorefront();\n } catch (error) {\n throw createPurchaseErrorFromNativeException(error, platform, {\n code: ErrorCode.ServiceError,\n message: 'Failed to get storefront.',\n debugMessage: error instanceof Error ? error.message : String(error),\n });\n }\n\n if (typeof storefront !== 'string' || storefront.trim().length === 0) {\n throw createPurchaseError({\n code: ErrorCode.ServiceError,\n message: 'Storefront lookup returned no country code.',\n platform,\n });\n }\n return storefront;\n};\n\n/**\n * Helper to normalize request props to platform-specific format\n */\nfunction normalizeRequestProps(\n request: RequestPurchasePropsByPlatforms,\n platform: 'ios',\n): RequestPurchaseIosProps | null | undefined;\nfunction normalizeRequestProps(\n request: RequestPurchasePropsByPlatforms,\n platform: 'android',\n): RequestPurchaseAndroidProps | null | undefined;\nfunction normalizeRequestProps(\n request: RequestSubscriptionPropsByPlatforms,\n platform: 'ios',\n): RequestSubscriptionIosProps | null | undefined;\nfunction normalizeRequestProps(\n request: RequestSubscriptionPropsByPlatforms,\n platform: 'android',\n): RequestSubscriptionAndroidProps | null | undefined;\nfunction normalizeRequestProps(\n request:\n | RequestPurchasePropsByPlatforms\n | RequestSubscriptionPropsByPlatforms,\n platform: 'ios' | 'android',\n) {\n // Support both new (apple/google) and legacy (ios/android) field names\n // New fields take precedence over deprecated ones\n if (platform === 'ios') {\n return request.apple ?? request.ios;\n }\n return request.google ?? request.android;\n}\n\n/**\n * Initiate a purchase or subscription flow. The result is delivered through\n * `purchaseUpdatedListener` — NOT the return value.\n *\n * @param args `RequestPurchaseProps`, discriminated by `type`:\n * - `type: 'in-app'` — pass `request.apple.sku` (iOS) and/or `request.google.skus` (Android).\n * - `type: 'subs'` — same shape, plus `request.google.subscriptionOffers: [{ sku, offerToken }]`.\n * @returns The dispatched purchase payload. **Do not rely on it** for the actual outcome.\n * @throws Synchronous rejection from the store (e.g. `E_NOT_PREPARED`, validation failure).\n *\n * @example\n * ```ts\n * await requestPurchase({\n * request: {\n * apple: { sku: 'com.app.premium' },\n * google: { skus: ['com.app.premium'] },\n * },\n * type: 'in-app',\n * });\n * ```\n *\n * @remarks Event-based. Listen for the result via {@link purchaseUpdatedListener} /\n * {@link purchaseErrorListener}, or use `useIAP({ onPurchaseSuccess, onPurchaseError })`.\n *\n * @see {@link https://openiap.dev/docs/apis/request-purchase}\n */\nexport const requestPurchase: MutationField<'requestPurchase'> = async (\n args,\n) => {\n const {request, type} = args;\n const {canonical, native} = normalizeProductType(type as ProductTypeInput);\n const isInAppPurchase = canonical === 'in-app';\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 Apple. The `sku` property is required and must be a string.\\n\\n' +\n 'Expected format:\\n' +\n ' requestPurchase({\\n' +\n ' request: {\\n' +\n ' apple: { sku: \"product_id\" },\\n' +\n ' google: { skus: [\"product_id\"] }\\n' +\n ' },\\n' +\n ' type: \"in-app\"\\n' +\n ' })\\n\\n' +\n 'See: https://openiap.dev/docs/apis/request-purchase',\n );\n }\n\n if (canonical !== 'in-app' && canonical !== 'subs') {\n throw new Error(`Unsupported product type: ${canonical}`);\n }\n\n const payload: MutationRequestPurchaseArgs = {\n type: canonical === 'in-app' ? 'in-app' : 'subs',\n request: {ios: normalizedRequest},\n useAlternativeBilling: args.useAlternativeBilling,\n };\n\n const purchase = (await invokeNativeWithPurchaseError(\n () => ExpoIapModule.requestPurchase(payload),\n 'ios',\n {\n code: ErrorCode.PurchaseError,\n message: 'Failed to request purchase',\n productId: normalizedRequest.sku,\n productIds: [normalizedRequest.sku],\n productType: canonical,\n },\n )) as Purchase | Purchase[] | null;\n\n if (Array.isArray(purchase)) {\n return normalizePurchaseArray(purchase);\n }\n\n if (purchase) {\n return normalizePurchasePlatform(purchase);\n }\n\n return canonical === 'subs' ? [] : null;\n }\n\n if (isAndroidStoreRuntime()) {\n if (isInAppPurchase) {\n const normalizedRequest = normalizeRequestProps(\n request as RequestPurchasePropsByPlatforms,\n 'android',\n ) as RequestPurchaseAndroidProps | null | undefined;\n\n if (!normalizedRequest?.skus?.length) {\n throw new Error(\n 'Invalid request for Google. The `skus` property is required and must be a non-empty array.\\n\\n' +\n 'Expected format:\\n' +\n ' requestPurchase({\\n' +\n ' request: {\\n' +\n ' apple: { sku: \"product_id\" },\\n' +\n ' google: { skus: [\"product_id\"] }\\n' +\n ' },\\n' +\n ' type: \"in-app\"\\n' +\n ' })\\n\\n' +\n 'See: https://openiap.dev/docs/apis/request-purchase',\n );\n }\n\n const {\n skus,\n obfuscatedAccountId,\n obfuscatedProfileId,\n isOfferPersonalized,\n offerToken,\n developerBillingOption,\n } = normalizedRequest;\n\n const result = (await invokeNativeWithPurchaseError(\n () =>\n ExpoIapModule.requestPurchase({\n type: native,\n skuArr: skus,\n purchaseToken: undefined,\n replacementMode: -1,\n obfuscatedAccountId: obfuscatedAccountId,\n obfuscatedProfileId: obfuscatedProfileId,\n offerToken: offerToken,\n developerBillingOption: developerBillingOption ?? undefined,\n offerTokenArr: [],\n isOfferPersonalized: isOfferPersonalized ?? false,\n }),\n 'android',\n {\n code: ErrorCode.PurchaseError,\n message: 'Failed to request purchase',\n productId: skus[0],\n productIds: skus,\n productType: canonical,\n },\n )) as Purchase[];\n\n return normalizePurchaseArray(result);\n }\n\n if (canonical === 'subs') {\n const normalizedRequest = normalizeRequestProps(\n request as RequestSubscriptionPropsByPlatforms,\n 'android',\n ) as RequestSubscriptionAndroidProps | null | undefined;\n\n if (!normalizedRequest?.skus?.length) {\n throw new Error(\n 'Invalid request for Google. The `skus` property is required and must be a non-empty array.\\n\\n' +\n 'Expected format:\\n' +\n ' requestPurchase({\\n' +\n ' request: {\\n' +\n ' apple: { sku: \"subscription_id\" },\\n' +\n ' google: { skus: [\"subscription_id\"] }\\n' +\n ' },\\n' +\n ' type: \"subs\"\\n' +\n ' })\\n\\n' +\n 'See: https://openiap.dev/docs/apis/request-purchase',\n );\n }\n\n const {\n skus,\n obfuscatedAccountId,\n obfuscatedProfileId,\n isOfferPersonalized,\n subscriptionOffers,\n replacementMode: replacementModeInput,\n purchaseToken: purchaseTokenInput,\n originalExternalTransactionId,\n developerBillingOption,\n subscriptionProductReplacementParams,\n } = normalizedRequest;\n\n const normalizedOffers = subscriptionOffers ?? [];\n const replacementMode = replacementModeInput ?? -1;\n const purchaseToken = purchaseTokenInput ?? undefined;\n\n const result = (await invokeNativeWithPurchaseError(\n () =>\n ExpoIapModule.requestPurchase({\n type: native,\n skuArr: skus,\n purchaseToken,\n originalExternalTransactionId:\n originalExternalTransactionId ?? undefined,\n replacementMode,\n obfuscatedAccountId: obfuscatedAccountId,\n obfuscatedProfileId: obfuscatedProfileId,\n offerTokenArr: normalizedOffers.map(\n (offer: AndroidSubscriptionOfferInput) => offer.offerToken,\n ),\n subscriptionOffers: normalizedOffers,\n isOfferPersonalized: isOfferPersonalized ?? false,\n developerBillingOption: developerBillingOption ?? undefined,\n subscriptionProductReplacementParams:\n subscriptionProductReplacementParams ?? undefined,\n }),\n 'android',\n {\n code: ErrorCode.PurchaseError,\n message: 'Failed to request purchase',\n productId: skus[0],\n productIds: skus,\n productType: canonical,\n },\n )) as Purchase[];\n\n return normalizePurchaseArray(result);\n }\n\n throw new Error(\n \"Invalid request for Android: Expected a valid request object with 'skus' array.\",\n );\n }\n\n throw unsupportedPlatformError();\n};\n\n/**\n * Complete a purchase transaction. Call after server-side verification to remove it\n * from the queue.\n *\n * @param args.purchase The `Purchase` to finalize.\n * @param args.isConsumable `true` for consumables (consumes the token so the SKU can be\n * re-bought, e.g. coins); `false` (default) for non-consumables and subscriptions.\n * @returns Promise that resolves once the platform finalizes the transaction.\n * @throws When the platform finalize call fails.\n *\n * @example\n * ```ts\n * // Inside purchaseUpdatedListener:\n * if (await verifyOnServer(purchase)) {\n * await finishTransaction({ purchase, isConsumable: false });\n * }\n * ```\n *\n * @remarks **Critical:** Android purchases must be finalized within 3 days or Google\n * auto-refunds. iOS unfinished transactions replay on every app launch.\n *\n * @see {@link https://openiap.dev/docs/apis/finish-transaction}\n */\nexport const finishTransaction: MutationField<'finishTransaction'> = async ({\n purchase,\n isConsumable = false,\n}) => {\n if (Platform.OS === 'ios') {\n await ExpoIapModule.finishTransaction(purchase, isConsumable);\n return;\n }\n\n if (isAndroidStoreRuntime()) {\n const token = purchase.purchaseToken ?? undefined;\n\n if (!token) {\n throw createPurchaseError({\n message: 'Purchase token is required to finish transaction',\n code: ErrorCode.DeveloperError,\n productId: purchase.productId,\n platform: 'android',\n });\n }\n\n if (isConsumable) {\n await ExpoIapModule.consumePurchaseAndroid(token);\n return;\n }\n\n await ExpoIapModule.acknowledgePurchaseAndroid(token);\n return;\n }\n\n throw unsupportedPlatformError();\n};\n\n/**\n * Restore completed transactions (cross-platform behavior)\n *\n * - iOS: perform a lightweight sync, or Onside restore when OnsideKit is active,\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 triggers the refresh flows but does not return the purchases; consumers should\n * call `getAvailablePurchases` or rely on hook state to inspect the latest items.\n *\n * @see {@link https://openiap.dev/docs/apis/restore-purchases}\n */\nexport const restorePurchases: MutationField<'restorePurchases'> = async () => {\n if (Platform.OS === 'ios') {\n const nativeModule = ExpoIapModule as any;\n\n if (\n nativeModule.USING_ONSIDE_SDK &&\n typeof nativeModule.restorePurchases === 'function'\n ) {\n await nativeModule.restorePurchases().catch(() => undefined);\n } else {\n await syncIOS().catch(() => undefined);\n }\n }\n\n await getAvailablePurchases({\n alsoPublishToEventListenerIOS: false,\n onlyIncludeActiveItemsIOS: true,\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 *\n * @see {@link https://openiap.dev/docs/apis/deep-link-to-subscriptions}\n */\nexport const deepLinkToSubscriptions: MutationField<\n 'deepLinkToSubscriptions'\n> = async (options) => {\n if (Platform.OS === 'ios') {\n await deepLinkToSubscriptionsIOS();\n return;\n }\n\n if (Platform.OS === 'android') {\n await deepLinkToSubscriptionsAndroid((options as DeepLinkOptions) ?? null);\n return;\n }\n\n throw unsupportedPlatformError();\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 *\n * @deprecated Use verifyPurchase instead\n *\n * @see {@link https://openiap.dev/docs/apis/validate-receipt}\n */\nexport const validateReceipt: MutationField<'validateReceipt'> = async (\n options,\n) => {\n const {apple, google} = options as MutationValidateReceiptArgs;\n\n if (Platform.OS === 'ios') {\n if (!apple?.sku) {\n throw new Error('iOS validation requires apple.sku');\n }\n return validateReceiptIOS({apple: {sku: apple.sku}});\n }\n\n if (Platform.OS === 'android') {\n if (\n !google ||\n !google.sku ||\n !google.packageName ||\n !google.purchaseToken ||\n !google.accessToken\n ) {\n throw new Error(\n 'Android validation requires google.sku, google.packageName, google.purchaseToken, and google.accessToken',\n );\n }\n return validateReceiptAndroid({\n packageName: google.packageName,\n productId: google.sku,\n productToken: google.purchaseToken,\n accessToken: google.accessToken,\n isSub: google.isSub ?? undefined,\n });\n }\n\n throw unsupportedPlatformError();\n};\n\n/**\n * Verify purchase with the configured providers\n *\n * This function uses the native OpenIAP verifyPurchase implementation\n * which validates purchases using platform-specific methods.\n *\n * @param options - Receipt validation options containing the SKU\n * @returns Promise resolving to receipt validation result\n *\n * @see {@link https://openiap.dev/docs/features/validation#verify-purchase}\n */\nexport const verifyPurchase: MutationField<'verifyPurchase'> = async (\n options,\n) => {\n if (!isStorePlatform()) {\n throw unsupportedPlatformError();\n }\n\n return ExpoIapModule.verifyPurchase(options);\n};\n\n/**\n * Verify purchase with a specific provider (e.g., IAPKit)\n *\n * This function allows you to verify purchases using external verification\n * services like IAPKit, which provide additional validation and security.\n *\n * @param options - Verification options including provider and credentials\n * @returns Promise resolving to provider-specific verification result\n *\n * @example\n * ```typescript\n * const result = await verifyPurchaseWithProvider({\n * provider: 'iapkit',\n * iapkit: {\n * apiKey: 'your-api-key',\n * // Choose exactly one store payload.\n * // apple: { jws: purchase.purchaseToken },\n * // google: { purchaseToken: purchase.purchaseToken },\n * amazon: {\n * userId: amazonUserId,\n * receiptId: purchase.purchaseToken,\n * sandbox: __DEV__,\n * }\n * }\n * });\n * ```\n *\n * @see {@link https://openiap.dev/docs/features/validation#verify-purchase-with-provider}\n */\nexport const verifyPurchaseWithProvider: MutationField<\n 'verifyPurchaseWithProvider'\n> = async (options) => {\n if (!isStoreRuntime()) {\n throw unsupportedPlatformError();\n }\n\n let resolvedOptions = options;\n\n if (\n resolvedOptions.provider === 'iapkit' &&\n resolvedOptions.iapkit &&\n !resolvedOptions.iapkit.apiKey\n ) {\n try {\n // Dynamically import expo-constants to avoid hard dependency\n const {default: Constants} = await import('expo-constants');\n const configApiKey = Constants.expoConfig?.extra?.iapkitApiKey;\n if (typeof configApiKey === 'string' && configApiKey.length > 0) {\n resolvedOptions = {\n ...resolvedOptions,\n iapkit: {\n ...resolvedOptions.iapkit,\n apiKey: configApiKey,\n },\n };\n }\n } catch {\n throw new Error(\n 'expo-constants is required for auto-filling iapkitApiKey from config. ' +\n 'Please install it: npx expo install expo-constants\\n' +\n 'Or provide apiKey directly in verifyPurchaseWithProvider options.',\n );\n }\n }\n\n return ExpoIapModule.verifyPurchaseWithProvider(resolvedOptions);\n};\n\nexport * from './useIAP';\nexport {useWebhookEvents} from './useWebhookEvents';\nexport type {\n UseWebhookEventsOptions,\n UseWebhookEventsResult,\n} from './useWebhookEvents';\nexport {connectWebhookStream, parseWebhookEventData} from './webhook-client';\nexport type {\n WebhookEventPayload,\n WebhookEventStream,\n WebhookEventType as WebhookEventTypeName,\n WebhookListener,\n WebhookListenerError,\n WebhookListenerOptions,\n} from './webhook-client';\nexport {kitApi, KitApiError} from './kit-api';\nexport type {\n KitApiOptions,\n KitSubscription,\n EntitlementsResponse,\n StatusResponse,\n} from './kit-api';\nexport {\n ErrorCodeUtils,\n ErrorCodeMapping,\n createPurchaseError,\n createPurchaseErrorFromPlatform,\n} from './utils/errorMapping';\nexport type {\n PurchaseError as ExpoPurchaseError,\n PurchaseErrorProps,\n} from './utils/errorMapping';\nexport {ExpoIapConsole} from './utils/debug';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AAEtC,mBAAmB;AACnB,OAAO,aAAa,EAAE,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAChC,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;AAC3B,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AA2B7C,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,sCAAsC,EACtC,6BAA6B,GAG9B,MAAM,sBAA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,EAAC,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5D,OAAO;QACL,GAAG,MAAM;QACT,MAAM,EAAE;YACN,GAAG,MAAM;YACT,GAAG,CAAC,aAAa,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,aAAa,EAAC,CAAC;YACjD,GAAG,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,SAAS,EAAC,CAAC;SAC1C;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,UAAU,CAAC;AACzB,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAKpD,OAAO,EAAC,oBAAoB,EAAE,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAS7E,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,WAAW,CAAC;AAc9C,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC","sourcesContent":["// External dependencies\nimport {Platform} from 'react-native';\n\n// Internal modules\nimport ExpoIapModule, {getNativeModule} from './ExpoIapModule';\nimport {isVegaOS} from './vega';\nimport {\n isProductIOS,\n validateReceiptIOS,\n deepLinkToSubscriptionsIOS,\n syncIOS,\n} from './modules/ios';\nimport {\n isProductAndroid,\n validateReceiptAndroid,\n deepLinkToSubscriptionsAndroid,\n} from './modules/android';\nimport {ExpoIapConsole} from './utils/debug';\n\n// Types\nimport type {\n ActiveSubscription,\n AndroidSubscriptionOfferInput,\n DeepLinkOptions,\n DeveloperProvidedBillingDetailsAndroid,\n IapPlatform,\n MutationField,\n MutationRequestPurchaseArgs,\n MutationValidateReceiptArgs,\n Product,\n ProductQueryType,\n ProductSubscription,\n Purchase,\n PurchaseOptions,\n PurchaseUpdatedListenerOptions,\n QueryField,\n RequestPurchasePropsByPlatforms,\n RequestPurchaseAndroidProps,\n RequestPurchaseIosProps,\n RequestSubscriptionPropsByPlatforms,\n RequestSubscriptionAndroidProps,\n RequestSubscriptionIosProps,\n UserChoiceBillingDetails,\n} from './types';\nimport {ErrorCode} from './types';\nimport {\n createPurchaseError,\n createPurchaseErrorFromNativeException,\n OPENIAP_ERROR_ENVELOPE_PREFIX,\n type PurchaseError,\n type PurchaseErrorProps,\n} from './utils/errorMapping';\n\n// Export all types\nexport * from './types';\nexport * from './modules/android';\nexport * from './modules/ios';\nexport * from './onside';\nexport * from './vega';\n\n// Get the native constant value\nexport enum OpenIapEvent {\n PurchaseUpdated = 'purchase-updated',\n PurchaseError = 'purchase-error',\n PromotedProductIOS = 'promoted-product-ios',\n UserChoiceBillingAndroid = 'user-choice-billing-android',\n /**\n * Fired for External Payments (8.3.0+) and Billing Choice (9.1.0+)\n * developer billing flows. Nullable fields depend on the selected flow.\n */\n DeveloperProvidedBillingAndroid = 'developer-provided-billing-android',\n /**\n * Fired when a subscription enters a billing-issue state (cross-platform).\n * Unifies StoreKit 2 `Message.Reason.billingIssue` (iOS / Mac Catalyst 16.4+, visionOS 1.0+) and Play Billing 8.1+\n * `Purchase.isSuspended`. NOT fired on the Meta Horizon flavor.\n */\n SubscriptionBillingIssue = 'subscription-billing-issue',\n}\n\ntype ExpoIapEventPayloads = {\n [OpenIapEvent.PurchaseUpdated]: Purchase;\n [OpenIapEvent.PurchaseError]: PurchaseError;\n [OpenIapEvent.PromotedProductIOS]:\n | Product\n | string\n | {id?: string; productId?: string};\n [OpenIapEvent.UserChoiceBillingAndroid]: UserChoiceBillingDetails;\n [OpenIapEvent.DeveloperProvidedBillingAndroid]: DeveloperProvidedBillingDetailsAndroid;\n [OpenIapEvent.SubscriptionBillingIssue]: Purchase;\n};\n\ntype ExpoIapEventListener<E extends OpenIapEvent> = (\n payload: ExpoIapEventPayloads[E],\n) => void;\n\ntype ExpoIapEmitter = {\n addListener<E extends OpenIapEvent>(\n eventName: E,\n listener: ExpoIapEventListener<E>,\n ): {remove: () => void};\n removeListener<E extends OpenIapEvent>(\n eventName: E,\n listener: ExpoIapEventListener<E>,\n ): void;\n};\n\ntype NativePurchaseUpdatedOptionsModule = {\n setPurchaseUpdatedListenerOptions?: (\n options?: PurchaseUpdatedListenerOptions | null,\n ) => Promise<void>;\n};\n\nconst isStorePlatform = (): boolean =>\n Platform.OS === 'ios' || Platform.OS === 'android';\n\nconst isStoreRuntime = (): boolean =>\n Platform.OS === 'ios' || isAndroidStoreRuntime();\n\nconst unsupportedPlatformError = (): Error =>\n new Error(`Unsupported platform: ${Platform.OS}`);\n\n// Use the raw native module for listener calls — JSI HostObjects require the\n// real native module as `this` when calling addListener. Using a Proxy as\n// `this` triggers \"native state unsupported on Proxy\" on New Architecture / Hermes.\n// Resolved lazily so importing this module doesn't throw on unsupported platforms.\nexport const emitter: ExpoIapEmitter = {\n addListener(eventName, listener) {\n const nativeModule = getNativeModule();\n const nativeSubscription = nativeModule.addListener(eventName, listener);\n let removed = false;\n\n return {\n remove: () => {\n if (removed) {\n return;\n }\n removed = true;\n\n if (typeof nativeSubscription?.remove === 'function') {\n nativeSubscription.remove();\n return;\n }\n\n nativeModule.removeListener?.(eventName, listener);\n },\n };\n },\n removeListener(eventName, listener) {\n return getNativeModule().removeListener?.(eventName, listener);\n },\n};\n\nlet nonDedupingPurchaseUpdatedListenerCountIOS = 0;\nconst purchaseUpdatedDedupeHistoryLimitIOS = 512;\nconst purchaseUpdatedDedupeHistoryIOS = {\n ids: new Set<string>(),\n order: [] as string[],\n start: 0,\n};\nlet purchaseUpdatedDedupeGenerationIOS = 0;\n\ntype PurchaseUpdatedDedupeHistoryIOS = {\n ids: Set<string>;\n order: string[];\n start: number;\n};\n\nconst purchaseUpdatedTransactionIdIOS = (purchase: Purchase) => {\n if (typeof purchase.id === 'string' && purchase.id.length > 0) {\n return purchase.id;\n }\n return null;\n};\n\nconst rememberPurchaseUpdatedTransactionIOS = (\n transactionId: string,\n history: PurchaseUpdatedDedupeHistoryIOS,\n) => {\n if (history.ids.has(transactionId)) {\n return;\n }\n\n history.ids.add(transactionId);\n history.order.push(transactionId);\n if (\n history.order.length - history.start >\n purchaseUpdatedDedupeHistoryLimitIOS\n ) {\n const evicted = history.order[history.start];\n history.start += 1;\n if (evicted != null) {\n history.ids.delete(evicted);\n }\n if (history.start > 128 && history.start * 2 > history.order.length) {\n history.order = history.order.slice(history.start);\n history.start = 0;\n }\n }\n};\n\nconst clearPurchaseUpdatedDedupeHistoryIOS = (\n history: PurchaseUpdatedDedupeHistoryIOS,\n) => {\n history.ids.clear();\n history.order.length = 0;\n history.start = 0;\n};\n\nconst resetPurchaseUpdatedDedupeHistoryIOS = () => {\n clearPurchaseUpdatedDedupeHistoryIOS(purchaseUpdatedDedupeHistoryIOS);\n purchaseUpdatedDedupeGenerationIOS += 1;\n};\n\nconst configurePurchaseUpdatedListenerOptionsIOS = (\n dedupeTransactionIOS: boolean,\n) => {\n if (Platform.OS !== 'ios') return;\n\n const nativeModule = getNativeModule() as NativePurchaseUpdatedOptionsModule;\n const promise = nativeModule.setPurchaseUpdatedListenerOptions?.({\n dedupeTransactionIOS,\n });\n void promise?.catch((error: unknown) => {\n ExpoIapConsole.warn(\n 'Failed to configure purchase updated listener options:',\n error,\n );\n });\n};\n\n/**\n * TODO(next-major): Remove legacy 'inapp' alias once downstream apps migrate to 'in-app'.\n */\nexport type ProductTypeInput = ProductQueryType | 'inapp';\n\nconst normalizeProductType = (type?: ProductTypeInput) => {\n if (type === 'inapp') {\n ExpoIapConsole.warn(\n \"'inapp' product type is deprecated and will be removed in a future major version. Use 'in-app' instead.\",\n );\n }\n\n if (!type || type === 'inapp' || type === 'in-app') {\n return {\n canonical: 'in-app' as ProductQueryType,\n native: 'in-app' as const,\n };\n }\n if (type === 'subs') {\n return {\n canonical: 'subs' as ProductQueryType,\n native: 'subs' as const,\n };\n }\n if (type === 'all') {\n return {\n canonical: 'all' as ProductQueryType,\n native: 'all' as const,\n };\n }\n throw new Error(`Unsupported product type: ${type}`);\n};\n\nconst normalizePurchasePlatform = (purchase: Purchase): Purchase => {\n const platform = purchase.platform;\n if (typeof platform !== 'string') {\n return purchase;\n }\n\n const lowered = platform.toLowerCase();\n if (lowered === platform || (lowered !== 'ios' && lowered !== 'android')) {\n return purchase;\n }\n\n return {...purchase, platform: lowered};\n};\n\nconst normalizePurchaseArray = (purchases: Purchase[]): Purchase[] =>\n purchases.map((purchase) => normalizePurchasePlatform(purchase));\n\nconst isAndroidStoreRuntime = (): boolean => {\n return Platform.OS === 'android' || isVegaOS();\n};\n\nexport const purchaseUpdatedListener = (\n listener: (event: Purchase) => void,\n options?: PurchaseUpdatedListenerOptions | null,\n) => {\n const receiveDuplicateTransactionUpdatesIOS =\n Platform.OS === 'ios' && options?.dedupeTransactionIOS === false;\n const listenerDedupeHistoryIOS: PurchaseUpdatedDedupeHistoryIOS = {\n ids: new Set(purchaseUpdatedDedupeHistoryIOS.ids),\n order: purchaseUpdatedDedupeHistoryIOS.order.slice(\n purchaseUpdatedDedupeHistoryIOS.start,\n ),\n start: 0,\n };\n let listenerDedupeGenerationIOS = purchaseUpdatedDedupeGenerationIOS;\n\n const wrappedListener = (event: Purchase) => {\n const normalized = normalizePurchasePlatform(event);\n if (Platform.OS === 'ios') {\n if (listenerDedupeGenerationIOS !== purchaseUpdatedDedupeGenerationIOS) {\n clearPurchaseUpdatedDedupeHistoryIOS(listenerDedupeHistoryIOS);\n listenerDedupeGenerationIOS = purchaseUpdatedDedupeGenerationIOS;\n }\n const transactionId = purchaseUpdatedTransactionIdIOS(normalized);\n if (transactionId != null) {\n const isDuplicateForListener =\n listenerDedupeHistoryIOS.ids.has(transactionId);\n rememberPurchaseUpdatedTransactionIOS(\n transactionId,\n listenerDedupeHistoryIOS,\n );\n rememberPurchaseUpdatedTransactionIOS(\n transactionId,\n purchaseUpdatedDedupeHistoryIOS,\n );\n if (!receiveDuplicateTransactionUpdatesIOS && isDuplicateForListener) {\n return;\n }\n }\n }\n listener(normalized);\n };\n const emitterSubscription = emitter.addListener(\n OpenIapEvent.PurchaseUpdated,\n wrappedListener,\n );\n\n if (!receiveDuplicateTransactionUpdatesIOS) {\n return emitterSubscription;\n }\n\n nonDedupingPurchaseUpdatedListenerCountIOS += 1;\n configurePurchaseUpdatedListenerOptionsIOS(false);\n let removed = false;\n\n return {\n remove: () => {\n if (removed) {\n return;\n }\n removed = true;\n try {\n emitterSubscription?.remove?.();\n } finally {\n nonDedupingPurchaseUpdatedListenerCountIOS = Math.max(\n 0,\n nonDedupingPurchaseUpdatedListenerCountIOS - 1,\n );\n configurePurchaseUpdatedListenerOptionsIOS(\n nonDedupingPurchaseUpdatedListenerCountIOS === 0,\n );\n }\n },\n };\n};\n\nexport const purchaseErrorListener = (\n listener: (error: PurchaseError) => void,\n) => {\n const wrappedListener = (error: PurchaseError) => {\n listener(error);\n };\n const emitterSubscription = emitter.addListener(\n OpenIapEvent.PurchaseError,\n wrappedListener,\n );\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 ExpoIapConsole.warn(\n 'promotedProductListenerIOS: This listener is only available on iOS',\n );\n return {remove: () => {}};\n }\n\n let deliveredProductId: string | undefined;\n const deliver = (product: Product) => {\n const productId =\n product.id ?? (product as Product & {productId?: string}).productId;\n if (productId && productId === deliveredProductId) {\n return;\n }\n deliveredProductId = productId;\n listener(product);\n };\n\n const replayPendingProduct = () => {\n let pendingProduct: Promise<Product | null> | undefined;\n try {\n pendingProduct = ExpoIapModule.getPromotedProductIOS() as\n | Promise<Product | null>\n | undefined;\n } catch {\n return Promise.resolve();\n }\n\n if (!pendingProduct || typeof pendingProduct.then !== 'function') {\n return Promise.resolve();\n }\n\n return pendingProduct\n .then((product: Product | null) => {\n if (product) {\n deliver(product);\n }\n })\n .catch(() => {});\n };\n\n const subscription = emitter.addListener(\n OpenIapEvent.PromotedProductIOS,\n (payload) => {\n if (typeof payload === 'string') {\n void replayPendingProduct();\n return;\n }\n\n deliver(payload as Product);\n },\n );\n\n void replayPendingProduct();\n\n return subscription;\n};\n\n/**\n * Android-only listener for User Choice Billing events.\n * This fires when a user selects alternative billing instead of Google Play billing\n * in the User Choice Billing dialog (only in 'user-choice' mode).\n *\n * @param listener - Callback function that receives the external transaction token and product IDs\n * @returns EventSubscription that can be used to unsubscribe\n *\n * @example\n * ```typescript\n * const subscription = userChoiceBillingListenerAndroid((details) => {\n * console.log('User selected alternative billing');\n * console.log('External transaction token received; send it to your backend without logging it.');\n * console.log('Products:', details.products);\n *\n * // Process payment in your system, then report token to Google\n * await processPaymentAndReportToken(details);\n * });\n *\n * // Later, clean up\n * subscription.remove();\n * ```\n *\n * @platform Android\n */\nexport const userChoiceBillingListenerAndroid = (\n listener: (details: UserChoiceBillingDetails) => void,\n) => {\n if (Platform.OS !== 'android') {\n ExpoIapConsole.warn(\n 'userChoiceBillingListenerAndroid: This listener is only available on Android',\n );\n return {remove: () => {}};\n }\n return emitter.addListener(OpenIapEvent.UserChoiceBillingAndroid, listener);\n};\n\n/**\n * Android-only listener for Developer Provided Billing events.\n * This fires when a user selects the developer's option in an External Payments\n * or Billing Choice purchase flow.\n *\n * Requires Google Play Billing Library 8.3.0+; Billing Choice fields require 9.1.0+.\n *\n * @param listener - Callback that receives selected products and flow details\n * @returns EventSubscription that can be used to unsubscribe\n *\n * @example\n * ```typescript\n * const subscription = developerProvidedBillingListenerAndroid(async (details) => {\n * await processPaymentWithYourGateway(details.products, details.linkUri);\n * if (details.externalTransactionToken) {\n * await reportExternalTransactionToGoogle(details.externalTransactionToken);\n * }\n * });\n *\n * // Later, clean up\n * subscription.remove();\n * ```\n *\n * @platform Android (8.3.0+; Billing Choice 9.1.0+)\n */\nexport const developerProvidedBillingListenerAndroid = (\n listener: (details: DeveloperProvidedBillingDetailsAndroid) => void,\n) => {\n if (Platform.OS !== 'android') {\n ExpoIapConsole.warn(\n 'developerProvidedBillingListenerAndroid: This listener is only available on Android',\n );\n return {remove: () => {}};\n }\n return emitter.addListener(\n OpenIapEvent.DeveloperProvidedBillingAndroid,\n listener,\n );\n};\n\n/**\n * Listen for subscription billing-issue events (cross-platform).\n *\n * Fires when a user's active subscription enters a state that needs attention\n * for a payment problem. Unifies:\n * - iOS / Mac Catalyst 16.4+ and visionOS 1.0+: StoreKit 2 `Message.Reason.billingIssue`.\n * - Android (Play Billing 8.1+): when `Purchase.isSuspendedAndroid === true`.\n * - Meta Horizon / iOS 17 / older platforms: never fires.\n *\n * Recommended UX: call `deepLinkToSubscriptions()` when this fires so the user\n * can update their payment method in the platform subscription center.\n *\n * @example\n * ```typescript\n * const subscription = subscriptionBillingIssueListener((purchase) => {\n * console.warn('Needs attention:', purchase.productId);\n * deepLinkToSubscriptions({\n * skuAndroid: purchase.productId,\n * packageNameAndroid: 'com.example.app',\n * });\n * });\n * ```\n */\nexport const subscriptionBillingIssueListener = (\n listener: (purchase: Purchase) => void,\n) => {\n // Mirror purchaseUpdatedListener's platform normalization so consumers get\n // a consistent payload regardless of native casing.\n const wrappedListener = (event: Purchase) => {\n listener(normalizePurchasePlatform(event));\n };\n return emitter.addListener(\n OpenIapEvent.SubscriptionBillingIssue,\n wrappedListener,\n );\n};\n\n/**\n * Initialize the store connection. Must be called before any other IAP API.\n *\n * @param config Optional connection config. Use `enableBillingProgramAndroid` (Android,\n * Play Billing 8.2.0+) to opt into a billing program. For Billing Choice 9.1.0+, set\n * `billingChoiceScreenTypeAndroid` to the renderer configured in Play Console.\n * iOS ignores Android-specific fields.\n * @returns Promise resolving to `true` when the platform billing client is connected.\n * @throws When the platform billing client fails to initialize.\n *\n * @example\n * ```ts\n * await initConnection();\n * await initConnection({ enableBillingProgramAndroid: 'external-offer' });\n * await initConnection({\n * enableBillingProgramAndroid: 'billing-choice',\n * billingChoiceScreenTypeAndroid: 'developer-rendered',\n * });\n * ```\n *\n * @remarks When using `useIAP()`, connection is auto-managed on mount/unmount —\n * pass options to the hook instead of calling this directly.\n *\n * @see {@link https://openiap.dev/docs/apis/init-connection}\n */\nexport const initConnection: MutationField<'initConnection'> = async (\n config,\n) => {\n const result = await ExpoIapModule.initConnection(config ?? null);\n if (\n result === true &&\n Platform.OS === 'ios' &&\n nonDedupingPurchaseUpdatedListenerCountIOS > 0\n ) {\n configurePurchaseUpdatedListenerOptionsIOS(false);\n }\n return result;\n};\n\n/**\n * Close the store connection and release resources.\n *\n * @see {@link https://openiap.dev/docs/apis/end-connection}\n */\nexport const endConnection: MutationField<'endConnection'> = async () => {\n const result = await ExpoIapModule.endConnection();\n if (result === true && Platform.OS === 'ios') {\n resetPurchaseUpdatedDedupeHistoryIOS();\n }\n return result;\n};\n\nconst invokeNativeWithPurchaseError = async <T>(\n operation: () => Promise<T>,\n platform: IapPlatform,\n fallback: PurchaseErrorProps,\n): Promise<T> => {\n try {\n return await operation();\n } catch (error) {\n const nativeError =\n typeof error === 'object' && error !== null\n ? (error as Record<string, unknown>)\n : undefined;\n const nativeMessage =\n typeof nativeError?.message === 'string'\n ? nativeError.message\n : typeof error === 'string'\n ? error\n : '';\n const hasCanonicalFields =\n nativeMessage.includes(OPENIAP_ERROR_ENVELOPE_PREFIX) ||\n nativeError?.code !== undefined ||\n nativeError?.responseCode !== undefined ||\n nativeError?.debugMessage !== undefined ||\n nativeError?.productId !== undefined ||\n nativeError?.productIds !== undefined;\n\n // Preserve the identity of unrelated JavaScript errors (including adapter\n // or test errors) while normalizing native OpenIAP rejections.\n if (!hasCanonicalFields) throw error;\n throw createPurchaseErrorFromNativeException(error, platform, fallback);\n }\n};\n\n/**\n * Retrieve products or subscriptions from the store by SKU.\n *\n * @param request `ProductRequest` — `skus` (string[]) and optional `type`\n * (`'in-app' | 'subs' | 'all'`, defaults to `'in-app'`).\n * @returns Promise resolving to a `FetchProductsResult` union — `Product[]` for `'in-app'`,\n * `ProductSubscription[]` for `'subs'`, or a mixed array for `'all'`.\n * @throws When the store rejects the request (empty `skus`, not connected,\n * network/store error). Unknown SKUs are simply omitted from the result, not thrown.\n *\n * @example\n * ```ts\n * const products = await fetchProducts({\n * skus: ['com.app.coins_100', 'com.app.premium'],\n * type: 'in-app',\n * });\n * ```\n *\n * @remarks This is a regular promise-based call. Don't confuse with `request*` APIs\n * (`requestPurchase`), which are event-based.\n *\n * @see {@link https://openiap.dev/docs/apis/fetch-products}\n */\nexport const fetchProducts: QueryField<'fetchProducts'> = async (request) => {\n ExpoIapConsole.debug('fetchProducts called with:', request);\n const {skus, type} = request ?? {};\n\n if (!Array.isArray(skus) || skus.length === 0) {\n throw createPurchaseError({\n message: 'No SKUs provided',\n code: ErrorCode.EmptySkuList,\n });\n }\n\n const {canonical, native} = normalizeProductType(\n type as ProductTypeInput | undefined,\n );\n const skuSet = new Set(skus);\n\n const filterIosItems = (\n items: unknown[],\n ): (Product | ProductSubscription)[] =>\n items.filter((item): item is Product | ProductSubscription => {\n if (!isProductIOS(item)) {\n return false;\n }\n const candidate = item as Product | ProductSubscription;\n return typeof candidate.id === 'string' && skuSet.has(candidate.id);\n });\n\n const filterAndroidItems = (\n items: unknown[],\n ): (Product | ProductSubscription)[] =>\n items.filter((item): item is Product | ProductSubscription => {\n if (!isProductAndroid(item)) {\n return false;\n }\n const candidate = item as Product | ProductSubscription;\n return typeof candidate.id === 'string' && skuSet.has(candidate.id);\n });\n\n const castResult = (\n items: (Product | ProductSubscription)[],\n ):\n | (Product | ProductSubscription)[]\n | Product[]\n | ProductSubscription[]\n | null => {\n if (canonical === 'in-app') {\n return items as Product[];\n }\n if (canonical === 'subs') {\n return items as ProductSubscription[];\n }\n // For 'all' type, items contain both Product and ProductSubscription\n // Return as ProductOrSubscription[] to preserve discriminated union\n return items;\n };\n\n if (Platform.OS === 'ios') {\n const rawItems = await invokeNativeWithPurchaseError<unknown[]>(\n () => ExpoIapModule.fetchProducts({skus, type: native}),\n 'ios',\n {\n code: ErrorCode.QueryProduct,\n message: 'Failed to query products',\n productIds: skus,\n productType: canonical,\n },\n );\n return castResult(filterIosItems(rawItems));\n }\n\n if (isAndroidStoreRuntime()) {\n const rawItems = await invokeNativeWithPurchaseError<unknown[]>(\n () => ExpoIapModule.fetchProducts(native, skus),\n 'android',\n {\n code: ErrorCode.QueryProduct,\n message: 'Failed to query products',\n productIds: skus,\n productType: canonical,\n },\n );\n return castResult(filterAndroidItems(rawItems));\n }\n\n throw unsupportedPlatformError();\n};\n\n/**\n * List the user's unfinished purchases — non-consumables, active subscriptions, and any\n * pending transactions not yet finished.\n *\n * @param options Optional `PurchaseOptions`. iOS-only flags:\n * `alsoPublishToEventListenerIOS`, `onlyIncludeActiveItemsIOS`.\n * @returns Promise resolving to an array of `Purchase` currently held by the store.\n * @throws When the platform query fails.\n *\n * @example\n * ```ts\n * const purchases = await getAvailablePurchases();\n * for (const p of purchases) {\n * if (await verifyOnServer(p)) await finishTransaction({ purchase: p, isConsumable: false });\n * }\n * ```\n *\n * @see {@link https://openiap.dev/docs/apis/get-available-purchases}\n */\nexport const getAvailablePurchases: QueryField<\n 'getAvailablePurchases'\n> = async (options) => {\n const normalizedOptions: PurchaseOptions = {\n alsoPublishToEventListenerIOS:\n options?.alsoPublishToEventListenerIOS ?? false,\n onlyIncludeActiveItemsIOS: options?.onlyIncludeActiveItemsIOS ?? true,\n includeSuspendedAndroid: options?.includeSuspendedAndroid ?? false,\n };\n\n if (isVegaOS()) {\n const purchases = await ExpoIapModule.getAvailableItems(normalizedOptions);\n return normalizePurchaseArray(purchases as Purchase[]);\n }\n\n let purchases: Purchase[];\n\n if (Platform.OS === 'ios') {\n purchases = (await ExpoIapModule.getAvailableItems(\n normalizedOptions.alsoPublishToEventListenerIOS,\n normalizedOptions.onlyIncludeActiveItemsIOS,\n )) as Purchase[];\n } else if (Platform.OS === 'android') {\n purchases = (await ExpoIapModule.getAvailableItems(\n normalizedOptions,\n )) as Purchase[];\n } else {\n throw unsupportedPlatformError();\n }\n\n return normalizePurchaseArray(purchases as Purchase[]);\n};\n\n/**\n * Get all active subscriptions with detailed information.\n * Uses native OpenIAP module for accurate subscription status and renewal info.\n *\n * On iOS: Returns subscriptions with renewalInfoIOS containing pendingUpgradeProductId,\n * willAutoRenew, autoRenewPreference, and other renewal details.\n *\n * On Android: Filters available purchases to find active subscriptions (fallback implementation).\n *\n * @param subscriptionIds - Optional array of subscription product IDs to filter. If not provided, returns all active subscriptions.\n * @returns Promise resolving to array of active subscriptions with details\n *\n * @example\n * ```typescript\n * // Get all active subscriptions\n * const subs = await getActiveSubscriptions();\n *\n * // Get specific subscriptions\n * const premiumSubs = await getActiveSubscriptions(['premium', 'premium_year']);\n *\n * // Check for pending upgrades (iOS)\n * subs.forEach(sub => {\n * if (sub.renewalInfoIOS?.pendingUpgradeProductId) {\n * console.log(`Upgrade pending to: ${sub.renewalInfoIOS.pendingUpgradeProductId}`);\n * }\n * });\n * ```\n *\n * @see {@link https://openiap.dev/docs/apis/get-active-subscriptions}\n */\nexport const getActiveSubscriptions: QueryField<\n 'getActiveSubscriptions'\n> = async (subscriptionIds) => {\n if (!isStoreRuntime()) {\n throw unsupportedPlatformError();\n }\n\n const result = await ExpoIapModule.getActiveSubscriptions(\n subscriptionIds ?? null,\n );\n return (result ?? []) as ActiveSubscription[];\n};\n\n/**\n * Check if user has any active subscriptions.\n *\n * @param subscriptionIds - Optional array of subscription product IDs to check. If not provided, checks all subscriptions.\n * @returns Promise resolving to true if user has at least one active subscription\n *\n * @example\n * ```typescript\n * // Check any active subscription\n * const hasAny = await hasActiveSubscriptions();\n *\n * // Check specific subscriptions\n * const hasPremium = await hasActiveSubscriptions(['premium', 'premium_year']);\n * ```\n *\n * @see {@link https://openiap.dev/docs/apis/has-active-subscriptions}\n */\nexport const hasActiveSubscriptions: QueryField<\n 'hasActiveSubscriptions'\n> = async (subscriptionIds) => {\n if (!isStoreRuntime()) {\n throw unsupportedPlatformError();\n }\n\n return !!(await ExpoIapModule.hasActiveSubscriptions(\n subscriptionIds ?? null,\n ));\n};\n\n/**\n * Return the user's storefront country code.\n *\n * @see {@link https://openiap.dev/docs/apis/get-storefront}\n */\nexport const getStorefront: QueryField<'getStorefront'> = async () => {\n if (Platform.OS !== 'ios' && !isAndroidStoreRuntime()) {\n throw createPurchaseError({\n code: ErrorCode.FeatureNotSupported,\n message: `Storefront lookup is not supported on ${Platform.OS}.`,\n });\n }\n\n const platform: IapPlatform = Platform.OS === 'ios' ? 'ios' : 'android';\n if (typeof ExpoIapModule.getStorefront !== 'function') {\n throw createPurchaseError({\n code: ErrorCode.FeatureNotSupported,\n message: 'Native getStorefront is not available on this build.',\n platform,\n });\n }\n\n let storefront: unknown;\n try {\n storefront = await ExpoIapModule.getStorefront();\n } catch (error) {\n throw createPurchaseErrorFromNativeException(error, platform, {\n code: ErrorCode.ServiceError,\n message: 'Failed to get storefront.',\n debugMessage: error instanceof Error ? error.message : String(error),\n });\n }\n\n if (typeof storefront !== 'string' || storefront.trim().length === 0) {\n throw createPurchaseError({\n code: ErrorCode.ServiceError,\n message: 'Storefront lookup returned no country code.',\n platform,\n });\n }\n return storefront;\n};\n\n/**\n * Helper to normalize request props to platform-specific format\n */\nfunction normalizeRequestProps(\n request: RequestPurchasePropsByPlatforms,\n platform: 'ios',\n): RequestPurchaseIosProps | null | undefined;\nfunction normalizeRequestProps(\n request: RequestPurchasePropsByPlatforms,\n platform: 'android',\n): RequestPurchaseAndroidProps | null | undefined;\nfunction normalizeRequestProps(\n request: RequestSubscriptionPropsByPlatforms,\n platform: 'ios',\n): RequestSubscriptionIosProps | null | undefined;\nfunction normalizeRequestProps(\n request: RequestSubscriptionPropsByPlatforms,\n platform: 'android',\n): RequestSubscriptionAndroidProps | null | undefined;\nfunction normalizeRequestProps(\n request:\n | RequestPurchasePropsByPlatforms\n | RequestSubscriptionPropsByPlatforms,\n platform: 'ios' | 'android',\n) {\n // Support both new (apple/google) and legacy (ios/android) field names\n // New fields take precedence over deprecated ones\n if (platform === 'ios') {\n return request.apple ?? request.ios;\n }\n return request.google ?? request.android;\n}\n\n/**\n * Initiate a purchase or subscription flow. The result is delivered through\n * `purchaseUpdatedListener` — NOT the return value.\n *\n * @param args `RequestPurchaseProps`, discriminated by `type`:\n * - `type: 'in-app'` — pass `request.apple.sku` (iOS) and/or `request.google.skus` (Android).\n * - `type: 'subs'` — same shape, plus `request.google.subscriptionOffers: [{ sku, offerToken }]`.\n * @returns The dispatched purchase payload. **Do not rely on it** for the actual outcome.\n * @throws Synchronous rejection from the store (e.g. `E_NOT_PREPARED`, validation failure).\n *\n * @example\n * ```ts\n * await requestPurchase({\n * request: {\n * apple: { sku: 'com.app.premium' },\n * google: { skus: ['com.app.premium'] },\n * },\n * type: 'in-app',\n * });\n * ```\n *\n * @remarks Event-based. Listen for the result via {@link purchaseUpdatedListener} /\n * {@link purchaseErrorListener}, or use `useIAP({ onPurchaseSuccess, onPurchaseError })`.\n *\n * @see {@link https://openiap.dev/docs/apis/request-purchase}\n */\nexport const requestPurchase: MutationField<'requestPurchase'> = async (\n args,\n) => {\n const {request, type} = args;\n const {canonical, native} = normalizeProductType(type as ProductTypeInput);\n const isInAppPurchase = canonical === 'in-app';\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 Apple. The `sku` property is required and must be a string.\\n\\n' +\n 'Expected format:\\n' +\n ' requestPurchase({\\n' +\n ' request: {\\n' +\n ' apple: { sku: \"product_id\" },\\n' +\n ' google: { skus: [\"product_id\"] }\\n' +\n ' },\\n' +\n ' type: \"in-app\"\\n' +\n ' })\\n\\n' +\n 'See: https://openiap.dev/docs/apis/request-purchase',\n );\n }\n\n if (canonical !== 'in-app' && canonical !== 'subs') {\n throw new Error(`Unsupported product type: ${canonical}`);\n }\n\n const payload: MutationRequestPurchaseArgs = {\n type: canonical === 'in-app' ? 'in-app' : 'subs',\n request: {ios: normalizedRequest},\n useAlternativeBilling: args.useAlternativeBilling,\n };\n\n const purchase = (await invokeNativeWithPurchaseError(\n () => ExpoIapModule.requestPurchase(payload),\n 'ios',\n {\n code: ErrorCode.PurchaseError,\n message: 'Failed to request purchase',\n productId: normalizedRequest.sku,\n productIds: [normalizedRequest.sku],\n productType: canonical,\n },\n )) as Purchase | Purchase[] | null;\n\n if (Array.isArray(purchase)) {\n return normalizePurchaseArray(purchase);\n }\n\n if (purchase) {\n return normalizePurchasePlatform(purchase);\n }\n\n return canonical === 'subs' ? [] : null;\n }\n\n if (isAndroidStoreRuntime()) {\n if (isInAppPurchase) {\n const normalizedRequest = normalizeRequestProps(\n request as RequestPurchasePropsByPlatforms,\n 'android',\n ) as RequestPurchaseAndroidProps | null | undefined;\n\n if (!normalizedRequest?.skus?.length) {\n throw new Error(\n 'Invalid request for Google. The `skus` property is required and must be a non-empty array.\\n\\n' +\n 'Expected format:\\n' +\n ' requestPurchase({\\n' +\n ' request: {\\n' +\n ' apple: { sku: \"product_id\" },\\n' +\n ' google: { skus: [\"product_id\"] }\\n' +\n ' },\\n' +\n ' type: \"in-app\"\\n' +\n ' })\\n\\n' +\n 'See: https://openiap.dev/docs/apis/request-purchase',\n );\n }\n\n const {\n skus,\n obfuscatedAccountId,\n obfuscatedProfileId,\n isOfferPersonalized,\n offerToken,\n developerBillingOption,\n } = normalizedRequest;\n\n const result = (await invokeNativeWithPurchaseError(\n () =>\n ExpoIapModule.requestPurchase({\n type: native,\n skuArr: skus,\n purchaseToken: undefined,\n replacementMode: -1,\n obfuscatedAccountId: obfuscatedAccountId,\n obfuscatedProfileId: obfuscatedProfileId,\n offerToken: offerToken,\n developerBillingOption: developerBillingOption ?? undefined,\n offerTokenArr: [],\n isOfferPersonalized: isOfferPersonalized ?? false,\n }),\n 'android',\n {\n code: ErrorCode.PurchaseError,\n message: 'Failed to request purchase',\n productId: skus[0],\n productIds: skus,\n productType: canonical,\n },\n )) as Purchase[];\n\n return normalizePurchaseArray(result);\n }\n\n if (canonical === 'subs') {\n const normalizedRequest = normalizeRequestProps(\n request as RequestSubscriptionPropsByPlatforms,\n 'android',\n ) as RequestSubscriptionAndroidProps | null | undefined;\n\n if (!normalizedRequest?.skus?.length) {\n throw new Error(\n 'Invalid request for Google. The `skus` property is required and must be a non-empty array.\\n\\n' +\n 'Expected format:\\n' +\n ' requestPurchase({\\n' +\n ' request: {\\n' +\n ' apple: { sku: \"subscription_id\" },\\n' +\n ' google: { skus: [\"subscription_id\"] }\\n' +\n ' },\\n' +\n ' type: \"subs\"\\n' +\n ' })\\n\\n' +\n 'See: https://openiap.dev/docs/apis/request-purchase',\n );\n }\n\n const {\n skus,\n obfuscatedAccountId,\n obfuscatedProfileId,\n isOfferPersonalized,\n subscriptionOffers,\n replacementMode: replacementModeInput,\n purchaseToken: purchaseTokenInput,\n originalExternalTransactionId,\n developerBillingOption,\n subscriptionProductReplacementParams,\n } = normalizedRequest;\n\n const normalizedOffers = subscriptionOffers ?? [];\n const replacementMode = replacementModeInput ?? -1;\n const purchaseToken = purchaseTokenInput ?? undefined;\n\n const result = (await invokeNativeWithPurchaseError(\n () =>\n ExpoIapModule.requestPurchase({\n type: native,\n skuArr: skus,\n purchaseToken,\n originalExternalTransactionId:\n originalExternalTransactionId ?? undefined,\n replacementMode,\n obfuscatedAccountId: obfuscatedAccountId,\n obfuscatedProfileId: obfuscatedProfileId,\n offerTokenArr: normalizedOffers.map(\n (offer: AndroidSubscriptionOfferInput) => offer.offerToken,\n ),\n subscriptionOffers: normalizedOffers,\n isOfferPersonalized: isOfferPersonalized ?? false,\n developerBillingOption: developerBillingOption ?? undefined,\n subscriptionProductReplacementParams:\n subscriptionProductReplacementParams ?? undefined,\n }),\n 'android',\n {\n code: ErrorCode.PurchaseError,\n message: 'Failed to request purchase',\n productId: skus[0],\n productIds: skus,\n productType: canonical,\n },\n )) as Purchase[];\n\n return normalizePurchaseArray(result);\n }\n\n throw new Error(\n \"Invalid request for Android: Expected a valid request object with 'skus' array.\",\n );\n }\n\n throw unsupportedPlatformError();\n};\n\n/**\n * Complete a purchase transaction. Call after server-side verification to remove it\n * from the queue.\n *\n * @param args.purchase The `Purchase` to finalize.\n * @param args.isConsumable `true` for consumables (consumes the token so the SKU can be\n * re-bought, e.g. coins); `false` (default) for non-consumables and subscriptions.\n * @returns Promise that resolves once the platform finalizes the transaction.\n * @throws When the platform finalize call fails.\n *\n * @example\n * ```ts\n * // Inside purchaseUpdatedListener:\n * if (await verifyOnServer(purchase)) {\n * await finishTransaction({ purchase, isConsumable: false });\n * }\n * ```\n *\n * @remarks **Critical:** Android purchases must be finalized within 3 days or Google\n * auto-refunds. iOS unfinished transactions replay on every app launch.\n *\n * @see {@link https://openiap.dev/docs/apis/finish-transaction}\n */\nexport const finishTransaction: MutationField<'finishTransaction'> = async ({\n purchase,\n isConsumable = false,\n}) => {\n if (Platform.OS === 'ios') {\n await ExpoIapModule.finishTransaction(purchase, isConsumable);\n return;\n }\n\n if (isAndroidStoreRuntime()) {\n const token = purchase.purchaseToken ?? undefined;\n\n if (!token) {\n throw createPurchaseError({\n message: 'Purchase token is required to finish transaction',\n code: ErrorCode.DeveloperError,\n productId: purchase.productId,\n platform: 'android',\n });\n }\n\n if (isConsumable) {\n await ExpoIapModule.consumePurchaseAndroid(token);\n return;\n }\n\n await ExpoIapModule.acknowledgePurchaseAndroid(token);\n return;\n }\n\n throw unsupportedPlatformError();\n};\n\n/**\n * Restore completed transactions (cross-platform behavior)\n *\n * - iOS: perform a lightweight sync, or Onside restore when OnsideKit is active,\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 triggers the refresh flows but does not return the purchases; consumers should\n * call `getAvailablePurchases` or rely on hook state to inspect the latest items.\n *\n * @see {@link https://openiap.dev/docs/apis/restore-purchases}\n */\nexport const restorePurchases: MutationField<'restorePurchases'> = async () => {\n if (Platform.OS === 'ios') {\n const nativeModule = ExpoIapModule as any;\n\n if (\n nativeModule.USING_ONSIDE_SDK &&\n typeof nativeModule.restorePurchases === 'function'\n ) {\n await nativeModule.restorePurchases().catch(() => undefined);\n } else {\n await syncIOS().catch(() => undefined);\n }\n }\n\n await getAvailablePurchases({\n alsoPublishToEventListenerIOS: false,\n onlyIncludeActiveItemsIOS: true,\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 *\n * @see {@link https://openiap.dev/docs/apis/deep-link-to-subscriptions}\n */\nexport const deepLinkToSubscriptions: MutationField<\n 'deepLinkToSubscriptions'\n> = async (options) => {\n if (Platform.OS === 'ios') {\n await deepLinkToSubscriptionsIOS();\n return;\n }\n\n if (Platform.OS === 'android') {\n await deepLinkToSubscriptionsAndroid((options as DeepLinkOptions) ?? null);\n return;\n }\n\n throw unsupportedPlatformError();\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 *\n * @deprecated Use verifyPurchase instead\n *\n * @see {@link https://openiap.dev/docs/apis/validate-receipt}\n */\nexport const validateReceipt: MutationField<'validateReceipt'> = async (\n options,\n) => {\n const {apple, google} = options as MutationValidateReceiptArgs;\n\n if (Platform.OS === 'ios') {\n if (!apple?.sku) {\n throw new Error('iOS validation requires apple.sku');\n }\n return validateReceiptIOS({apple: {sku: apple.sku}});\n }\n\n if (Platform.OS === 'android') {\n if (\n !google ||\n !google.sku ||\n !google.packageName ||\n !google.purchaseToken ||\n !google.accessToken\n ) {\n throw new Error(\n 'Android validation requires google.sku, google.packageName, google.purchaseToken, and google.accessToken',\n );\n }\n return validateReceiptAndroid({\n packageName: google.packageName,\n productId: google.sku,\n productToken: google.purchaseToken,\n accessToken: google.accessToken,\n isSub: google.isSub ?? undefined,\n });\n }\n\n throw unsupportedPlatformError();\n};\n\n/**\n * Verify purchase with the configured providers\n *\n * This function uses the native OpenIAP verifyPurchase implementation\n * which validates purchases using platform-specific methods.\n *\n * @param options - Receipt validation options containing the SKU\n * @returns Promise resolving to receipt validation result\n *\n * @see {@link https://openiap.dev/docs/features/validation#verify-purchase}\n */\nexport const verifyPurchase: MutationField<'verifyPurchase'> = async (\n options,\n) => {\n if (!isStorePlatform()) {\n throw unsupportedPlatformError();\n }\n\n return ExpoIapModule.verifyPurchase(options);\n};\n\n/**\n * Verify purchase with a specific provider (e.g., IAPKit)\n *\n * This function allows you to verify purchases using external verification\n * services like IAPKit, which provide additional validation and security.\n *\n * @param options - Verification options including provider and credentials\n * @returns Promise resolving to provider-specific verification result\n *\n * @example\n * ```typescript\n * const result = await verifyPurchaseWithProvider({\n * provider: 'iapkit',\n * iapkit: {\n * apiKey: 'your-api-key',\n * // Choose exactly one store payload.\n * // apple: { jws: purchase.purchaseToken },\n * // google: { purchaseToken: purchase.purchaseToken },\n * amazon: {\n * userId: amazonUserId,\n * receiptId: purchase.purchaseToken,\n * sandbox: __DEV__,\n * }\n * }\n * });\n * ```\n *\n * @see {@link https://openiap.dev/docs/features/validation#verify-purchase-with-provider}\n */\nexport const verifyPurchaseWithProvider: MutationField<\n 'verifyPurchaseWithProvider'\n> = async (options) => {\n if (!isStoreRuntime()) {\n throw unsupportedPlatformError();\n }\n\n let resolvedOptions = options;\n\n if (\n resolvedOptions.provider === 'iapkit' &&\n resolvedOptions.iapkit &&\n !resolvedOptions.iapkit.apiKey\n ) {\n try {\n // Dynamically import expo-constants to avoid hard dependency\n const {default: Constants} = await import('expo-constants');\n const configApiKey = Constants.expoConfig?.extra?.iapkitApiKey;\n if (typeof configApiKey === 'string' && configApiKey.length > 0) {\n resolvedOptions = {\n ...resolvedOptions,\n iapkit: {\n ...resolvedOptions.iapkit,\n apiKey: configApiKey,\n },\n };\n }\n } catch {\n throw new Error(\n 'expo-constants is required for auto-filling iapkitApiKey from config. ' +\n 'Please install it: npx expo install expo-constants\\n' +\n 'Or provide apiKey directly in verifyPurchaseWithProvider options.',\n );\n }\n }\n\n const result = await ExpoIapModule.verifyPurchaseWithProvider(\n resolvedOptions,\n );\n if (result.iapkit == null) {\n return result;\n }\n\n const {clientPayload, productId, ...iapkit} = result.iapkit;\n return {\n ...result,\n iapkit: {\n ...iapkit,\n ...(clientPayload == null ? {} : {clientPayload}),\n ...(productId == null ? {} : {productId}),\n },\n };\n};\n\nexport * from './useIAP';\nexport {useWebhookEvents} from './useWebhookEvents';\nexport type {\n UseWebhookEventsOptions,\n UseWebhookEventsResult,\n} from './useWebhookEvents';\nexport {connectWebhookStream, parseWebhookEventData} from './webhook-client';\nexport type {\n WebhookEventPayload,\n WebhookEventStream,\n WebhookEventType as WebhookEventTypeName,\n WebhookListener,\n WebhookListenerError,\n WebhookListenerOptions,\n} from './webhook-client';\nexport {kitApi, KitApiError} from './kit-api';\nexport type {\n KitApiOptions,\n KitClientPayloadResponse,\n KitProduct,\n KitProductClientPayload,\n KitProductOffer,\n KitProductPlatform,\n KitProductsOptions,\n KitProductsResponse,\n KitSubscription,\n EntitlementsResponse,\n StatusResponse,\n} from './kit-api';\nexport {\n ErrorCodeUtils,\n ErrorCodeMapping,\n createPurchaseError,\n createPurchaseErrorFromPlatform,\n} from './utils/errorMapping';\nexport type {\n PurchaseError as ExpoPurchaseError,\n PurchaseErrorProps,\n} from './utils/errorMapping';\nexport {ExpoIapConsole} from './utils/debug';\n"]}
|
package/build/index.kepler.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './types';
|
|
|
3
3
|
export * from './vega';
|
|
4
4
|
export * from './useIAP';
|
|
5
5
|
export { kitApi, KitApiError } from './kit-api';
|
|
6
|
+
export type { EntitlementsResponse, KitApiOptions, KitClientPayloadResponse, KitProduct, KitProductClientPayload, KitProductOffer, KitProductPlatform, KitProductsOptions, KitProductsResponse, KitSubscription, StatusResponse, } from './kit-api';
|
|
6
7
|
export { connectWebhookStream, parseWebhookEventData } from './webhook-client';
|
|
7
8
|
export declare enum OpenIapEvent {
|
|
8
9
|
PurchaseUpdated = "purchase-updated",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.kepler.d.ts","sourceRoot":"","sources":["../src/index.kepler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,aAAa,EAEb,8BAA8B,EAC9B,UAAU,EAGX,MAAM,SAAS,CAAC;AAEjB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAC,oBAAoB,EAAE,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAE7E,oBAAY,YAAY;IACtB,eAAe,qBAAqB;IACpC,aAAa,mBAAmB;IAChC,kBAAkB,yBAAyB;IAC3C,wBAAwB,gCAAgC;IACxD,+BAA+B,uCAAuC;IACtE,wBAAwB,+BAA+B;CACxD;AAED,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,OAAO,CAAC;AAE1D,MAAM,WAAW,iBAAiB;IAChC,MAAM,IAAI,IAAI,CAAC;CAChB;AAiDD,eAAO,MAAM,OAAO;2BAEL,YAAY,YACb,CAAC,OAAO,EAAE,QAAQ,GAAG,aAAa,KAAK,I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AAC;AAC1E,MAAM,CAAC,MAAM,mCAAmC,GAE5C,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,qCAAqC,CAAC,CAAC;AACnE,MAAM,CAAC,MAAM,oCAAoC,GAE7C,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,sCAAsC,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,gCAAgC,GAEzC,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,kCAAkC,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,2BAA2B,GAEpC,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,6BAA6B,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,yBAAyB,GAElC,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,2CAA2C,GAEpD,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,6CAA6C,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,0CAA0C,GAEnD,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,4CAA4C,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,wBAAwB,GAEjC,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC","sourcesContent":["import {getVegaIapModule} from './vega';\nimport {ErrorCode} from './types';\nimport type {\n MutationField,\n ProductQueryType,\n Purchase,\n PurchaseError,\n PurchaseOptions,\n PurchaseUpdatedListenerOptions,\n QueryField,\n RequestPurchasePropsByPlatforms,\n RequestSubscriptionPropsByPlatforms,\n} from './types';\n\nexport * from './types';\nexport * from './vega';\nexport * from './useIAP';\nexport {kitApi, KitApiError} from './kit-api';\nexport {connectWebhookStream, parseWebhookEventData} from './webhook-client';\n\nexport enum OpenIapEvent {\n PurchaseUpdated = 'purchase-updated',\n PurchaseError = 'purchase-error',\n PromotedProductIOS = 'promoted-product-ios',\n UserChoiceBillingAndroid = 'user-choice-billing-android',\n DeveloperProvidedBillingAndroid = 'developer-provided-billing-android',\n SubscriptionBillingIssue = 'subscription-billing-issue',\n}\n\nexport type ProductTypeInput = ProductQueryType | 'inapp';\n\nexport interface EventSubscription {\n remove(): void;\n}\n\nconst getModule = () => {\n const module = getVegaIapModule();\n if (!module) {\n throw new Error(\n 'Amazon Vega IAP module is unavailable. Install @amazon-devices/keplerscript-appstore-iap-lib in the Vega app target and build with the React Native for Vega kepler platform.',\n );\n }\n return module;\n};\n\nconst unsupported = (feature: string): never => {\n throw new Error(`${feature} is not supported on Amazon Vega.`);\n};\n\nconst normalizeProductType = (\n type?: ProductTypeInput | null,\n): ProductQueryType => {\n if (type === 'subs' || type === 'all') return type;\n return 'in-app';\n};\n\nconst normalizePurchaseArray = (purchases: Purchase[]): Purchase[] =>\n purchases.map((purchase) => {\n const platform = String(purchase.platform).toLowerCase();\n if (platform === purchase.platform) return purchase;\n if (platform === 'android' || platform === 'ios') {\n return {...purchase, platform};\n }\n return purchase;\n });\n\nconst getAndroidRequest = (\n request?:\n | RequestPurchasePropsByPlatforms\n | RequestSubscriptionPropsByPlatforms\n | null,\n) => request?.google ?? request?.android;\n\nconst createPurchaseTokenError = (purchase: Purchase): Error => {\n const error = new Error(\n 'Purchase token is required to finish Amazon Vega transaction',\n ) as Error & PurchaseError;\n error.code = ErrorCode.DeveloperError;\n error.productId = purchase.productId;\n return error;\n};\n\nexport const emitter = {\n addListener(\n eventName: OpenIapEvent,\n listener: (payload: Purchase | PurchaseError) => void,\n ): EventSubscription {\n return getModule().addListener(eventName, listener);\n },\n removeListener(\n eventName: OpenIapEvent,\n listener: (payload: Purchase | PurchaseError) => void,\n ): void {\n return getModule().removeListener(eventName, listener);\n },\n};\n\nexport const purchaseUpdatedListener = (\n listener: (event: Purchase) => void,\n options?: PurchaseUpdatedListenerOptions | null,\n): EventSubscription => {\n return getModule().addListener(OpenIapEvent.PurchaseUpdated, (purchase) => {\n listener(purchase as Purchase);\n });\n};\n\nexport const purchaseErrorListener = (\n listener: (error: PurchaseError) => void,\n): EventSubscription => {\n return getModule().addListener(OpenIapEvent.PurchaseError, (error) => {\n listener(error as PurchaseError);\n });\n};\n\nexport const initConnection: MutationField<'initConnection'> = async (\n config,\n) => {\n return getModule().initConnection(config ?? null);\n};\n\nexport const endConnection: MutationField<'endConnection'> = async () => {\n return getModule().endConnection();\n};\n\nexport const fetchProducts: QueryField<'fetchProducts'> = async (request) => {\n const {skus, type} = request;\n return getModule().fetchProducts(normalizeProductType(type), skus);\n};\n\nexport const requestPurchase: MutationField<'requestPurchase'> = async (\n args,\n) => {\n const androidRequest = getAndroidRequest(args.request);\n if (!androidRequest?.skus?.length) {\n throw new Error(\n 'Invalid request for Amazon Vega. The `request.google.skus` or `request.android.skus` property is required and must be a non-empty array.',\n );\n }\n\n return normalizePurchaseArray(\n await getModule().requestPurchase({\n skuArr: androidRequest.skus,\n type: normalizeProductType(args.type),\n }),\n );\n};\n\nexport const getAvailablePurchases: QueryField<\n 'getAvailablePurchases'\n> = async (options) => {\n return normalizePurchaseArray(\n await getModule().getAvailableItems((options ?? {}) as PurchaseOptions),\n );\n};\n\nexport const finishTransaction: MutationField<'finishTransaction'> = async ({\n purchase,\n isConsumable = false,\n}) => {\n const token = purchase.purchaseToken ?? undefined;\n if (!token) {\n throw createPurchaseTokenError(purchase);\n }\n\n if (isConsumable) {\n await getModule().consumePurchaseAndroid(token);\n return;\n }\n\n await getModule().acknowledgePurchaseAndroid(token);\n};\n\nexport const restorePurchases: MutationField<'restorePurchases'> = async () => {\n await getAvailablePurchases({\n includeSuspendedAndroid: false,\n });\n};\n\nexport const getActiveSubscriptions: QueryField<\n 'getActiveSubscriptions'\n> = async (subscriptionIds) => {\n return getModule().getActiveSubscriptions(subscriptionIds ?? null);\n};\n\nexport const hasActiveSubscriptions: QueryField<\n 'hasActiveSubscriptions'\n> = async (subscriptionIds) => {\n return getModule().hasActiveSubscriptions(subscriptionIds ?? null);\n};\n\nexport const getStorefront: QueryField<'getStorefront'> = async () => {\n return getModule().getStorefront();\n};\n\nexport const verifyPurchaseWithProvider: MutationField<\n 'verifyPurchaseWithProvider'\n> = async (options) => {\n return getModule().verifyPurchaseWithProvider(options);\n};\n\nexport const validateReceipt: MutationField<'validateReceipt'> = async () =>\n unsupported('validateReceipt');\n\nexport const verifyPurchase: MutationField<'verifyPurchase'> = validateReceipt;\n\nexport const acknowledgePurchaseAndroid: MutationField<\n 'acknowledgePurchaseAndroid'\n> = async (purchaseToken) => {\n await getModule().acknowledgePurchaseAndroid(purchaseToken);\n return true;\n};\n\nexport const consumePurchaseAndroid: MutationField<\n 'consumePurchaseAndroid'\n> = async (purchaseToken) => {\n await getModule().consumePurchaseAndroid(purchaseToken);\n return true;\n};\n\nexport const acknowledgePurchase = acknowledgePurchaseAndroid;\nexport const consumePurchase = consumePurchaseAndroid;\n\nexport const syncIOS: MutationField<'syncIOS'> = async () =>\n unsupported('syncIOS');\nexport const getAppTransactionIOS: QueryField<\n 'getAppTransactionIOS'\n> = async () => null;\nexport const getPromotedProductIOS: QueryField<\n 'getPromotedProductIOS'\n> = async () => null;\nexport const requestPurchaseOnPromotedProductIOS = async (): Promise<boolean> =>\n unsupported('requestPurchaseOnPromotedProductIOS');\nexport const showManageSubscriptionsIOS: MutationField<\n 'showManageSubscriptionsIOS'\n> = async () => [];\nexport const presentCodeRedemptionSheetIOS: MutationField<\n 'presentCodeRedemptionSheetIOS'\n> = async () => false;\nexport const presentExternalPurchaseLinkIOS: MutationField<\n 'presentExternalPurchaseLinkIOS'\n> = async () => unsupported('presentExternalPurchaseLinkIOS');\n\nexport const deepLinkToSubscriptions: MutationField<\n 'deepLinkToSubscriptions'\n> = async () => unsupported('deepLinkToSubscriptions');\nexport const openRedeemOfferCodeAndroid = async (): Promise<void> =>\n unsupported('openRedeemOfferCodeAndroid');\n\nexport const promotedProductListenerIOS = (): EventSubscription => ({\n remove: () => {},\n});\nexport const userChoiceBillingListenerAndroid = (): EventSubscription => ({\n remove: () => {},\n});\nexport const developerProvidedBillingListenerAndroid =\n (): EventSubscription => ({\n remove: () => {},\n });\nexport const subscriptionBillingIssueListener = (): EventSubscription => ({\n remove: () => {},\n});\n\nexport const checkAlternativeBillingAvailabilityAndroid: MutationField<\n 'checkAlternativeBillingAvailabilityAndroid'\n> = async () => unsupported('checkAlternativeBillingAvailabilityAndroid');\nexport const showAlternativeBillingDialogAndroid: MutationField<\n 'showAlternativeBillingDialogAndroid'\n> = async () => unsupported('showAlternativeBillingDialogAndroid');\nexport const createAlternativeBillingTokenAndroid: MutationField<\n 'createAlternativeBillingTokenAndroid'\n> = async () => unsupported('createAlternativeBillingTokenAndroid');\nexport const isBillingProgramAvailableAndroid: MutationField<\n 'isBillingProgramAvailableAndroid'\n> = async () => unsupported('isBillingProgramAvailableAndroid');\nexport const getBillingChoiceInfoAndroid: QueryField<\n 'getBillingChoiceInfoAndroid'\n> = async () => unsupported('getBillingChoiceInfoAndroid');\nexport const launchExternalLinkAndroid: MutationField<\n 'launchExternalLinkAndroid'\n> = async () => unsupported('launchExternalLinkAndroid');\nexport const createBillingProgramReportingDetailsAndroid: MutationField<\n 'createBillingProgramReportingDetailsAndroid'\n> = async () => unsupported('createBillingProgramReportingDetailsAndroid');\nexport const showBillingProgramInformationDialogAndroid: MutationField<\n 'showBillingProgramInformationDialogAndroid'\n> = async () => unsupported('showBillingProgramInformationDialogAndroid');\nexport const showInAppMessagesAndroid: MutationField<\n 'showInAppMessagesAndroid'\n> = async () => unsupported('showInAppMessagesAndroid');\n"]}
|
|
1
|
+
{"version":3,"file":"index.kepler.js","sourceRoot":"","sources":["../src/index.kepler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAalC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,WAAW,CAAC;AAc9C,OAA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AC,WAAW,CAAC,4CAA4C,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,wBAAwB,GAEjC,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC","sourcesContent":["import {getVegaIapModule} from './vega';\nimport {ErrorCode} from './types';\nimport type {\n MutationField,\n ProductQueryType,\n Purchase,\n PurchaseError,\n PurchaseOptions,\n PurchaseUpdatedListenerOptions,\n QueryField,\n RequestPurchasePropsByPlatforms,\n RequestSubscriptionPropsByPlatforms,\n} from './types';\n\nexport * from './types';\nexport * from './vega';\nexport * from './useIAP';\nexport {kitApi, KitApiError} from './kit-api';\nexport type {\n EntitlementsResponse,\n KitApiOptions,\n KitClientPayloadResponse,\n KitProduct,\n KitProductClientPayload,\n KitProductOffer,\n KitProductPlatform,\n KitProductsOptions,\n KitProductsResponse,\n KitSubscription,\n StatusResponse,\n} from './kit-api';\nexport {connectWebhookStream, parseWebhookEventData} from './webhook-client';\n\nexport enum OpenIapEvent {\n PurchaseUpdated = 'purchase-updated',\n PurchaseError = 'purchase-error',\n PromotedProductIOS = 'promoted-product-ios',\n UserChoiceBillingAndroid = 'user-choice-billing-android',\n DeveloperProvidedBillingAndroid = 'developer-provided-billing-android',\n SubscriptionBillingIssue = 'subscription-billing-issue',\n}\n\nexport type ProductTypeInput = ProductQueryType | 'inapp';\n\nexport interface EventSubscription {\n remove(): void;\n}\n\nconst getModule = () => {\n const module = getVegaIapModule();\n if (!module) {\n throw new Error(\n 'Amazon Vega IAP module is unavailable. Install @amazon-devices/keplerscript-appstore-iap-lib in the Vega app target and build with the React Native for Vega kepler platform.',\n );\n }\n return module;\n};\n\nconst unsupported = (feature: string): never => {\n throw new Error(`${feature} is not supported on Amazon Vega.`);\n};\n\nconst normalizeProductType = (\n type?: ProductTypeInput | null,\n): ProductQueryType => {\n if (type === 'subs' || type === 'all') return type;\n return 'in-app';\n};\n\nconst normalizePurchaseArray = (purchases: Purchase[]): Purchase[] =>\n purchases.map((purchase) => {\n const platform = String(purchase.platform).toLowerCase();\n if (platform === purchase.platform) return purchase;\n if (platform === 'android' || platform === 'ios') {\n return {...purchase, platform};\n }\n return purchase;\n });\n\nconst getAndroidRequest = (\n request?:\n | RequestPurchasePropsByPlatforms\n | RequestSubscriptionPropsByPlatforms\n | null,\n) => request?.google ?? request?.android;\n\nconst createPurchaseTokenError = (purchase: Purchase): Error => {\n const error = new Error(\n 'Purchase token is required to finish Amazon Vega transaction',\n ) as Error & PurchaseError;\n error.code = ErrorCode.DeveloperError;\n error.productId = purchase.productId;\n return error;\n};\n\nexport const emitter = {\n addListener(\n eventName: OpenIapEvent,\n listener: (payload: Purchase | PurchaseError) => void,\n ): EventSubscription {\n return getModule().addListener(eventName, listener);\n },\n removeListener(\n eventName: OpenIapEvent,\n listener: (payload: Purchase | PurchaseError) => void,\n ): void {\n return getModule().removeListener(eventName, listener);\n },\n};\n\nexport const purchaseUpdatedListener = (\n listener: (event: Purchase) => void,\n options?: PurchaseUpdatedListenerOptions | null,\n): EventSubscription => {\n return getModule().addListener(OpenIapEvent.PurchaseUpdated, (purchase) => {\n listener(purchase as Purchase);\n });\n};\n\nexport const purchaseErrorListener = (\n listener: (error: PurchaseError) => void,\n): EventSubscription => {\n return getModule().addListener(OpenIapEvent.PurchaseError, (error) => {\n listener(error as PurchaseError);\n });\n};\n\nexport const initConnection: MutationField<'initConnection'> = async (\n config,\n) => {\n return getModule().initConnection(config ?? null);\n};\n\nexport const endConnection: MutationField<'endConnection'> = async () => {\n return getModule().endConnection();\n};\n\nexport const fetchProducts: QueryField<'fetchProducts'> = async (request) => {\n const {skus, type} = request;\n return getModule().fetchProducts(normalizeProductType(type), skus);\n};\n\nexport const requestPurchase: MutationField<'requestPurchase'> = async (\n args,\n) => {\n const androidRequest = getAndroidRequest(args.request);\n if (!androidRequest?.skus?.length) {\n throw new Error(\n 'Invalid request for Amazon Vega. The `request.google.skus` or `request.android.skus` property is required and must be a non-empty array.',\n );\n }\n\n return normalizePurchaseArray(\n await getModule().requestPurchase({\n skuArr: androidRequest.skus,\n type: normalizeProductType(args.type),\n }),\n );\n};\n\nexport const getAvailablePurchases: QueryField<\n 'getAvailablePurchases'\n> = async (options) => {\n return normalizePurchaseArray(\n await getModule().getAvailableItems((options ?? {}) as PurchaseOptions),\n );\n};\n\nexport const finishTransaction: MutationField<'finishTransaction'> = async ({\n purchase,\n isConsumable = false,\n}) => {\n const token = purchase.purchaseToken ?? undefined;\n if (!token) {\n throw createPurchaseTokenError(purchase);\n }\n\n if (isConsumable) {\n await getModule().consumePurchaseAndroid(token);\n return;\n }\n\n await getModule().acknowledgePurchaseAndroid(token);\n};\n\nexport const restorePurchases: MutationField<'restorePurchases'> = async () => {\n await getAvailablePurchases({\n includeSuspendedAndroid: false,\n });\n};\n\nexport const getActiveSubscriptions: QueryField<\n 'getActiveSubscriptions'\n> = async (subscriptionIds) => {\n return getModule().getActiveSubscriptions(subscriptionIds ?? null);\n};\n\nexport const hasActiveSubscriptions: QueryField<\n 'hasActiveSubscriptions'\n> = async (subscriptionIds) => {\n return getModule().hasActiveSubscriptions(subscriptionIds ?? null);\n};\n\nexport const getStorefront: QueryField<'getStorefront'> = async () => {\n return getModule().getStorefront();\n};\n\nexport const verifyPurchaseWithProvider: MutationField<\n 'verifyPurchaseWithProvider'\n> = async (options) => {\n return getModule().verifyPurchaseWithProvider(options);\n};\n\nexport const validateReceipt: MutationField<'validateReceipt'> = async () =>\n unsupported('validateReceipt');\n\nexport const verifyPurchase: MutationField<'verifyPurchase'> = validateReceipt;\n\nexport const acknowledgePurchaseAndroid: MutationField<\n 'acknowledgePurchaseAndroid'\n> = async (purchaseToken) => {\n await getModule().acknowledgePurchaseAndroid(purchaseToken);\n return true;\n};\n\nexport const consumePurchaseAndroid: MutationField<\n 'consumePurchaseAndroid'\n> = async (purchaseToken) => {\n await getModule().consumePurchaseAndroid(purchaseToken);\n return true;\n};\n\nexport const acknowledgePurchase = acknowledgePurchaseAndroid;\nexport const consumePurchase = consumePurchaseAndroid;\n\nexport const syncIOS: MutationField<'syncIOS'> = async () =>\n unsupported('syncIOS');\nexport const getAppTransactionIOS: QueryField<\n 'getAppTransactionIOS'\n> = async () => null;\nexport const getPromotedProductIOS: QueryField<\n 'getPromotedProductIOS'\n> = async () => null;\nexport const requestPurchaseOnPromotedProductIOS = async (): Promise<boolean> =>\n unsupported('requestPurchaseOnPromotedProductIOS');\nexport const showManageSubscriptionsIOS: MutationField<\n 'showManageSubscriptionsIOS'\n> = async () => [];\nexport const presentCodeRedemptionSheetIOS: MutationField<\n 'presentCodeRedemptionSheetIOS'\n> = async () => false;\nexport const presentExternalPurchaseLinkIOS: MutationField<\n 'presentExternalPurchaseLinkIOS'\n> = async () => unsupported('presentExternalPurchaseLinkIOS');\n\nexport const deepLinkToSubscriptions: MutationField<\n 'deepLinkToSubscriptions'\n> = async () => unsupported('deepLinkToSubscriptions');\nexport const openRedeemOfferCodeAndroid = async (): Promise<void> =>\n unsupported('openRedeemOfferCodeAndroid');\n\nexport const promotedProductListenerIOS = (): EventSubscription => ({\n remove: () => {},\n});\nexport const userChoiceBillingListenerAndroid = (): EventSubscription => ({\n remove: () => {},\n});\nexport const developerProvidedBillingListenerAndroid =\n (): EventSubscription => ({\n remove: () => {},\n });\nexport const subscriptionBillingIssueListener = (): EventSubscription => ({\n remove: () => {},\n});\n\nexport const checkAlternativeBillingAvailabilityAndroid: MutationField<\n 'checkAlternativeBillingAvailabilityAndroid'\n> = async () => unsupported('checkAlternativeBillingAvailabilityAndroid');\nexport const showAlternativeBillingDialogAndroid: MutationField<\n 'showAlternativeBillingDialogAndroid'\n> = async () => unsupported('showAlternativeBillingDialogAndroid');\nexport const createAlternativeBillingTokenAndroid: MutationField<\n 'createAlternativeBillingTokenAndroid'\n> = async () => unsupported('createAlternativeBillingTokenAndroid');\nexport const isBillingProgramAvailableAndroid: MutationField<\n 'isBillingProgramAvailableAndroid'\n> = async () => unsupported('isBillingProgramAvailableAndroid');\nexport const getBillingChoiceInfoAndroid: QueryField<\n 'getBillingChoiceInfoAndroid'\n> = async () => unsupported('getBillingChoiceInfoAndroid');\nexport const launchExternalLinkAndroid: MutationField<\n 'launchExternalLinkAndroid'\n> = async () => unsupported('launchExternalLinkAndroid');\nexport const createBillingProgramReportingDetailsAndroid: MutationField<\n 'createBillingProgramReportingDetailsAndroid'\n> = async () => unsupported('createBillingProgramReportingDetailsAndroid');\nexport const showBillingProgramInformationDialogAndroid: MutationField<\n 'showBillingProgramInformationDialogAndroid'\n> = async () => unsupported('showBillingProgramInformationDialogAndroid');\nexport const showInAppMessagesAndroid: MutationField<\n 'showInAppMessagesAndroid'\n> = async () => unsupported('showInAppMessagesAndroid');\n"]}
|
package/build/kit-api.d.ts
CHANGED
|
@@ -28,6 +28,59 @@ export type StatusResponse = {
|
|
|
28
28
|
active: boolean;
|
|
29
29
|
subscription: KitSubscription | null;
|
|
30
30
|
};
|
|
31
|
+
export type KitProductPlatform = "IOS" | "Android";
|
|
32
|
+
export type KitProductClientPayload = {
|
|
33
|
+
format: "toml" | "json" | "text";
|
|
34
|
+
body: string;
|
|
35
|
+
version: number;
|
|
36
|
+
updatedAt: number;
|
|
37
|
+
};
|
|
38
|
+
export type KitProductOffer = {
|
|
39
|
+
id: string;
|
|
40
|
+
kind: "FreeTrial" | "IntroPayUpFront" | "IntroPayAsYouGo" | "PromotionalOffer" | "BasePlan";
|
|
41
|
+
duration?: string;
|
|
42
|
+
numberOfPeriods?: number;
|
|
43
|
+
priceAmountMicros?: number;
|
|
44
|
+
currency?: string;
|
|
45
|
+
};
|
|
46
|
+
export type KitProduct = {
|
|
47
|
+
productId: string;
|
|
48
|
+
platform: KitProductPlatform;
|
|
49
|
+
type: "Subscription" | "NonConsumable" | "Consumable";
|
|
50
|
+
title: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
priceAmountMicros?: number;
|
|
53
|
+
currency?: string;
|
|
54
|
+
state: "Draft" | "Ready" | "Active" | "Removed";
|
|
55
|
+
storeRef?: string;
|
|
56
|
+
subscriptionGroupId?: string;
|
|
57
|
+
subscriptionGroupName?: string;
|
|
58
|
+
billingPeriod?: "P1W" | "P1M" | "P2M" | "P3M" | "P6M" | "P1Y";
|
|
59
|
+
offers?: KitProductOffer[];
|
|
60
|
+
updatedAt: number;
|
|
61
|
+
clientPayload?: KitProductClientPayload;
|
|
62
|
+
};
|
|
63
|
+
export type KitProductsOptions = {
|
|
64
|
+
platform?: KitProductPlatform;
|
|
65
|
+
/** Include public client payload bodies in a bounded platform page. */
|
|
66
|
+
includeClientPayload?: boolean;
|
|
67
|
+
/** Page size for payload-inclusive reads (default 25, maximum 50).
|
|
68
|
+
* Ignored by the legacy non-payload catalog path. */
|
|
69
|
+
limit?: number;
|
|
70
|
+
/** Opaque cursor returned as `nextCursor` by the previous payload page.
|
|
71
|
+
* Ignored by the legacy non-payload catalog path. */
|
|
72
|
+
cursor?: string;
|
|
73
|
+
};
|
|
74
|
+
export type KitProductsResponse = {
|
|
75
|
+
products: KitProduct[];
|
|
76
|
+
/** Present on payload-inclusive catalog pages. */
|
|
77
|
+
hasMore?: boolean;
|
|
78
|
+
/** Present when a payload-inclusive catalog page has another page. */
|
|
79
|
+
nextCursor?: string;
|
|
80
|
+
};
|
|
81
|
+
export type KitClientPayloadResponse = {
|
|
82
|
+
clientPayload: KitProductClientPayload;
|
|
83
|
+
};
|
|
31
84
|
export declare class KitApiError extends Error {
|
|
32
85
|
readonly status: number;
|
|
33
86
|
readonly body: unknown;
|
|
@@ -43,6 +96,13 @@ export declare function kitApi(options: KitApiOptions): {
|
|
|
43
96
|
* is entitled to. Use this when feature gating depends on which
|
|
44
97
|
* specific tier the user owns. */
|
|
45
98
|
entitlements: (userId: string) => Promise<EntitlementsResponse>;
|
|
99
|
+
/** GET /v1/products — read the store-synced catalog. Client payloads
|
|
100
|
+
* are excluded unless explicitly requested because they may add up to
|
|
101
|
+
* 16 KiB per product. */
|
|
102
|
+
products: (productOptions?: KitProductsOptions) => Promise<KitProductsResponse>;
|
|
103
|
+
/** GET one public client payload by its store-specific natural key.
|
|
104
|
+
* Payloads are app-facing data; never store secrets in them. */
|
|
105
|
+
clientPayload: (productId: string, platform: KitProductPlatform) => Promise<KitClientPayloadResponse>;
|
|
46
106
|
/** POST /v1/subscriptions/bind-user — call after a successful
|
|
47
107
|
* verifyReceipt so kit knows which userId owns the verified
|
|
48
108
|
* `purchaseToken`. Idempotent. */
|