expo-iap 4.7.0 → 4.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/.prettierignore +0 -1
  2. package/CLAUDE.md +1 -1
  3. package/CONTRIBUTING.md +6 -6
  4. package/android/src/main/java/expo/modules/iap/ExpoIapHelper.kt +78 -7
  5. package/android/src/main/java/expo/modules/iap/ExpoIapLog.kt +46 -28
  6. package/android/src/main/java/expo/modules/iap/ExpoIapModule.kt +3 -2
  7. package/build/ExpoIapModule.d.ts.map +1 -1
  8. package/build/ExpoIapModule.js +8 -22
  9. package/build/ExpoIapModule.js.map +1 -1
  10. package/build/index.d.ts +4 -7
  11. package/build/index.d.ts.map +1 -1
  12. package/build/index.js +23 -13
  13. package/build/index.js.map +1 -1
  14. package/build/index.kepler.d.ts +39 -4
  15. package/build/index.kepler.d.ts.map +1 -1
  16. package/build/index.kepler.js +45 -2
  17. package/build/index.kepler.js.map +1 -1
  18. package/build/kit-api.d.ts +18 -8
  19. package/build/kit-api.d.ts.map +1 -1
  20. package/build/kit-api.js +90 -3
  21. package/build/kit-api.js.map +1 -1
  22. package/build/modules/android.d.ts +9 -1
  23. package/build/modules/android.d.ts.map +1 -1
  24. package/build/modules/android.js +9 -1
  25. package/build/modules/android.js.map +1 -1
  26. package/build/modules/ios.d.ts +27 -5
  27. package/build/modules/ios.d.ts.map +1 -1
  28. package/build/modules/ios.js +20 -16
  29. package/build/modules/ios.js.map +1 -1
  30. package/build/types.d.ts +105 -176
  31. package/build/types.d.ts.map +1 -1
  32. package/build/types.js +4 -1
  33. package/build/types.js.map +1 -1
  34. package/build/useIAP.d.ts +19 -4
  35. package/build/useIAP.d.ts.map +1 -1
  36. package/build/useIAP.js +2 -1
  37. package/build/useIAP.js.map +1 -1
  38. package/build/utils/deprecation.d.ts +3 -0
  39. package/build/utils/deprecation.d.ts.map +1 -0
  40. package/build/utils/deprecation.js +13 -0
  41. package/build/utils/deprecation.js.map +1 -0
  42. package/build/vega-adapter.d.ts +1 -0
  43. package/build/vega-adapter.d.ts.map +1 -1
  44. package/build/vega-adapter.js +20 -13
  45. package/build/vega-adapter.js.map +1 -1
  46. package/ios/ExpoIapHelper.swift +42 -7
  47. package/ios/ExpoIapLog.swift +15 -0
  48. package/ios/onside/OnsideIapModule.swift +127 -16
  49. package/openiap-versions.json +3 -3
  50. package/package.json +1 -1
  51. package/plugin/build/onsidePodfile.d.ts +1 -0
  52. package/plugin/build/onsidePodfile.js +16 -0
  53. package/plugin/build/withIAP.d.ts +12 -2
  54. package/plugin/build/withIAP.js +124 -59
  55. package/plugin/build/withLocalOpenIAP.d.ts +2 -0
  56. package/plugin/build/withLocalOpenIAP.js +18 -0
  57. package/plugin/src/expoConfig.augmentation.d.ts +16 -5
  58. package/plugin/src/onsidePodfile.ts +15 -0
  59. package/plugin/src/withIAP.ts +195 -77
  60. package/plugin/src/withLocalOpenIAP.ts +23 -0
  61. package/scripts/update-types.mjs +112 -81
  62. package/src/ExpoIapModule.ts +19 -23
  63. package/src/index.kepler.ts +72 -3
  64. package/src/index.ts +34 -30
  65. package/src/kit-api.ts +136 -13
  66. package/src/modules/android.ts +9 -1
  67. package/src/modules/ios.ts +26 -22
  68. package/src/types.ts +116 -204
  69. package/src/useIAP.ts +21 -5
  70. package/src/utils/deprecation.ts +16 -0
  71. package/src/vega-adapter.ts +23 -12
  72. package/build/useWebhookEvents.d.ts +0 -26
  73. package/build/useWebhookEvents.d.ts.map +0 -1
  74. package/build/useWebhookEvents.js +0 -105
  75. package/build/useWebhookEvents.js.map +0 -1
  76. package/build/webhook-client.d.ts +0 -82
  77. package/build/webhook-client.d.ts.map +0 -1
  78. package/build/webhook-client.js +0 -176
  79. package/build/webhook-client.js.map +0 -1
  80. package/src/useWebhookEvents.ts +0 -155
  81. package/src/webhook-client.ts +0 -312
@@ -106,14 +106,16 @@ export declare const showManageSubscriptionsIOS: MutationField<'showManageSubscr
106
106
  * @see {@link https://openiap.dev/docs/apis/ios/get-receipt-data-ios}
107
107
  */
108
108
  export declare const getReceiptDataIOS: QueryField<'getReceiptDataIOS'>;
109
+ /**
110
+ * @deprecated Use `getReceiptDataIOS` instead. This compatibility alias will
111
+ * be removed in expo-iap 5.0.0.
112
+ */
109
113
  export declare const getReceiptIOS: () => Promise<string | null>;
110
114
  /**
111
115
  * Get the current App Store storefront country code on iOS.
112
116
  *
113
117
  * @deprecated Use cross-platform `getStorefront` from the main index instead.
114
- * The native module exposes a single `getStorefront` AsyncFunction that already
115
- * resolves to the iOS storefront on iOS. This helper is kept as an iOS-only
116
- * alias so consumers who previously imported `getStorefrontIOS` do not break.
118
+ * This compatibility alias will be removed in expo-iap 5.0.0.
117
119
  *
118
120
  * @returns {Promise<string>} ISO 3166-1 alpha-3 country code (e.g. "USA")
119
121
  * @throws Error if called on non-iOS platform — Android callers must use the
@@ -162,6 +164,25 @@ export declare const isTransactionVerifiedIOS: QueryField<'isTransactionVerified
162
164
  * @see {@link https://openiap.dev/docs/apis/ios/get-transaction-jws-ios}
163
165
  */
164
166
  export declare const getTransactionJwsIOS: QueryField<'getTransactionJwsIOS'>;
167
+ /**
168
+ * Validate receipt for iOS using StoreKit 2's built-in verification.
169
+ * Returns receipt data and verification information to help with server-side validation.
170
+ *
171
+ * NOTE: For proper security, Apple recommends verifying receipts on your server using
172
+ * the verifyReceipt endpoint rather than relying solely on client-side verification.
173
+ *
174
+ * @deprecated Use `verifyPurchase` instead. Scheduled for removal in
175
+ * expo-iap 5.0.0.
176
+ * @param props The product's SKU or verification props
177
+ * @returns {Promise<{
178
+ * isValid: boolean;
179
+ * receiptData: string;
180
+ * jwsRepresentation: string;
181
+ * latestTransaction?: Purchase;
182
+ * }>}
183
+ *
184
+ * @see {@link https://openiap.dev/docs/apis/ios/validate-receipt-ios}
185
+ */
165
186
  export declare const validateReceiptIOS: QueryField<"validateReceiptIOS">;
166
187
  /**
167
188
  * Present the code redemption sheet for offer codes (iOS only).
@@ -211,8 +232,9 @@ export declare const getPromotedProductIOS: QueryField<'getPromotedProductIOS'>;
211
232
  * Complete the purchase of a promoted product (iOS only).
212
233
  * This should be called after showing your purchase UI for a promoted product.
213
234
  *
214
- * @deprecated Use promotedProductListenerIOS to receive the productId,
215
- * then call requestPurchase with that SKU instead.
235
+ * @deprecated Use promotedProductListenerIOS to receive the productId, then
236
+ * call requestPurchase with that SKU instead. This function will be removed in
237
+ * expo-iap 5.0.0.
216
238
  *
217
239
  * @returns Promise resolving when the purchase is initiated
218
240
  * @throws Error if called on non-iOS platform or no promoted product is available
@@ -1 +1 @@
1
- {"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../src/modules/ios.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAKV,aAAa,EAEb,QAAQ,EAER,UAAU,EAIX,MAAM,UAAU,CAAC;AAClB,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,uBAAuB,CAAC;AAe/B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAKF,wBAAgB,YAAY,CAAC,CAAC,SAAS;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAC,EACxD,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,CAAC,GAAG;IAAC,QAAQ,EAAE,KAAK,CAAA;CAAC,CAQ/B;AAGD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,SAAS,CAG5C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B,EAAE,UAAU,CACjD,4BAA4B,CAO7B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,EAAE,UAAU,CAC5C,uBAAuB,CAQxB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,EAAE,UAAU,CAC5C,uBAAuB,CAQxB,CAAC;AAEF;;;;;;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AAE,aAAa,CACjE,yCAAyC,CAY1C,CAAC"}
@@ -167,14 +167,16 @@ export const getReceiptDataIOS = async () => {
167
167
  requireIosPlatform('getReceiptDataIOS');
168
168
  return ExpoIapModule.getReceiptDataIOS();
169
169
  };
170
+ /**
171
+ * @deprecated Use `getReceiptDataIOS` instead. This compatibility alias will
172
+ * be removed in expo-iap 5.0.0.
173
+ */
170
174
  export const getReceiptIOS = getReceiptDataIOS;
171
175
  /**
172
176
  * Get the current App Store storefront country code on iOS.
173
177
  *
174
178
  * @deprecated Use cross-platform `getStorefront` from the main index instead.
175
- * The native module exposes a single `getStorefront` AsyncFunction that already
176
- * resolves to the iOS storefront on iOS. This helper is kept as an iOS-only
177
- * alias so consumers who previously imported `getStorefrontIOS` do not break.
179
+ * This compatibility alias will be removed in expo-iap 5.0.0.
178
180
  *
179
181
  * @returns {Promise<string>} ISO 3166-1 alpha-3 country code (e.g. "USA")
180
182
  * @throws Error if called on non-iOS platform — Android callers must use the
@@ -267,6 +269,16 @@ export const getTransactionJwsIOS = async (sku) => {
267
269
  const jws = await ExpoIapModule.getTransactionJwsIOS(sku);
268
270
  return jws ?? '';
269
271
  };
272
+ const validateReceiptIOSImpl = async (props) => {
273
+ requireIosPlatform('validateReceiptIOS');
274
+ const sku = typeof props === 'string'
275
+ ? props
276
+ : props?.apple?.sku;
277
+ if (!sku) {
278
+ throw new Error('validateReceiptIOS requires a SKU (via apple.sku)');
279
+ }
280
+ return (await ExpoIapModule.validateReceiptIOS(sku));
281
+ };
270
282
  /**
271
283
  * Validate receipt for iOS using StoreKit 2's built-in verification.
272
284
  * Returns receipt data and verification information to help with server-side validation.
@@ -274,7 +286,8 @@ export const getTransactionJwsIOS = async (sku) => {
274
286
  * NOTE: For proper security, Apple recommends verifying receipts on your server using
275
287
  * the verifyReceipt endpoint rather than relying solely on client-side verification.
276
288
  *
277
- * @deprecated Use verifyPurchase instead
289
+ * @deprecated Use `verifyPurchase` instead. Scheduled for removal in
290
+ * expo-iap 5.0.0.
278
291
  * @param props The product's SKU or verification props
279
292
  * @returns {Promise<{
280
293
  * isValid: boolean;
@@ -285,16 +298,6 @@ export const getTransactionJwsIOS = async (sku) => {
285
298
  *
286
299
  * @see {@link https://openiap.dev/docs/apis/ios/validate-receipt-ios}
287
300
  */
288
- const validateReceiptIOSImpl = async (props) => {
289
- requireIosPlatform('validateReceiptIOS');
290
- const sku = typeof props === 'string'
291
- ? props
292
- : props?.apple?.sku;
293
- if (!sku) {
294
- throw new Error('validateReceiptIOS requires a SKU (via apple.sku)');
295
- }
296
- return (await ExpoIapModule.validateReceiptIOS(sku));
297
- };
298
301
  export const validateReceiptIOS = validateReceiptIOSImpl;
299
302
  /**
300
303
  * Present the code redemption sheet for offer codes (iOS only).
@@ -354,8 +357,9 @@ export const getPromotedProductIOS = async () => {
354
357
  * Complete the purchase of a promoted product (iOS only).
355
358
  * This should be called after showing your purchase UI for a promoted product.
356
359
  *
357
- * @deprecated Use promotedProductListenerIOS to receive the productId,
358
- * then call requestPurchase with that SKU instead.
360
+ * @deprecated Use promotedProductListenerIOS to receive the productId, then
361
+ * call requestPurchase with that SKU instead. This function will be removed in
362
+ * expo-iap 5.0.0.
359
363
  *
360
364
  * @returns Promise resolving when the purchase is initiated
361
365
  * @throws Error if called on non-iOS platform or no promoted product is available
@@ -1 +1 @@
1
- {"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/modules/ios.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,mBAAmB;AACnB,mEAAmE;AACnE,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AAiBnC,OAAO,EACL,mBAAmB,EACnB,sCAAsC,GAEvC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,CAAC,UAAkB,EAAQ,EAAE;IACtD,IAAI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,uEAAuE","sourcesContent":["// External dependencies\n\n// Internal modules\n// import removed: use purchaseUpdatedListener directly in app code\nimport ExpoIapModule from '../ExpoIapModule';\nimport {ErrorCode} from '../types';\n\n// Types\nimport type {\n ExternalPurchaseCustomLinkNoticeResultIOS,\n ExternalPurchaseCustomLinkTokenResultIOS,\n ExternalPurchaseLinkResultIOS,\n ExternalPurchaseNoticeResultIOS,\n MutationField,\n ProductIOS,\n Purchase,\n PurchaseIOS,\n QueryField,\n VerifyPurchaseProps,\n VerifyPurchaseResultIOS,\n SubscriptionStatusIOS,\n} from '../types';\nimport {\n createPurchaseError,\n createPurchaseErrorFromNativeException,\n type PurchaseError,\n} from '../utils/errorMapping';\nimport {Linking, Platform} from 'react-native';\n\n/**\n * Enforce the documented iOS-only contract. Without this, calling a\n * suffixed wrapper on another platform falls through to the native proxy\n * and surfaces as an opaque `TypeError: ExpoIapModule.<name> is not a\n * function` instead of the promised platform error.\n */\nconst requireIosPlatform = (methodName: string): void => {\n if (Platform.OS !== 'ios') {\n throw new Error(`${methodName} is only available on iOS`);\n }\n};\n\nexport type TransactionEvent = {\n transaction?: Purchase;\n error?: PurchaseError;\n};\n\n// Listeners\n\n// Type guards\nexport function isProductIOS<T extends {platform?: string}>(\n item: unknown,\n): item is T & {platform: 'ios'} {\n return (\n item != null &&\n typeof item === 'object' &&\n 'platform' in item &&\n typeof (item as any).platform === 'string' &&\n (item as any).platform.toLowerCase() === 'ios'\n );\n}\n\n// Functions\n/**\n * Sync state with Appstore (iOS only)\n * https://developer.apple.com/documentation/storekit/appstore/3791906-sync\n *\n * @returns Promise resolving to null on success\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/sync-ios}\n */\nexport const syncIOS: MutationField<'syncIOS'> = async () => {\n requireIosPlatform('syncIOS');\n return !!(await ExpoIapModule.syncIOS());\n};\n\n/**\n * Check if user is eligible for introductory offer\n *\n * @param groupId - The subscription group ID\n * @returns Promise resolving to true if eligible\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/is-eligible-for-intro-offer-ios}\n */\nexport const isEligibleForIntroOfferIOS: QueryField<\n 'isEligibleForIntroOfferIOS'\n> = async (groupId) => {\n requireIosPlatform('isEligibleForIntroOfferIOS');\n if (!groupId) {\n throw new Error('isEligibleForIntroOfferIOS requires a groupId');\n }\n return ExpoIapModule.isEligibleForIntroOfferIOS(groupId);\n};\n\n/**\n * Get subscription status for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to array of subscription status\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/subscription-status-ios}\n */\nexport const subscriptionStatusIOS: QueryField<\n 'subscriptionStatusIOS'\n> = async (sku) => {\n requireIosPlatform('subscriptionStatusIOS');\n if (!sku) {\n throw new Error('subscriptionStatusIOS requires a SKU');\n }\n const status = await ExpoIapModule.subscriptionStatusIOS(sku);\n return (status ?? []) as SubscriptionStatusIOS[];\n};\n\n/**\n * Get current entitlement for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to current entitlement\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/current-entitlement-ios}\n */\nexport const currentEntitlementIOS: QueryField<\n 'currentEntitlementIOS'\n> = async (sku) => {\n requireIosPlatform('currentEntitlementIOS');\n if (!sku) {\n throw new Error('currentEntitlementIOS requires a SKU');\n }\n const purchase = await ExpoIapModule.currentEntitlementIOS(sku);\n return (purchase ?? null) as PurchaseIOS | null;\n};\n\n/**\n * Get latest transaction for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to latest transaction\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/latest-transaction-ios}\n */\nexport const latestTransactionIOS: QueryField<'latestTransactionIOS'> = async (\n sku,\n) => {\n requireIosPlatform('latestTransactionIOS');\n if (!sku) {\n throw new Error('latestTransactionIOS requires a SKU');\n }\n const transaction = await ExpoIapModule.latestTransactionIOS(sku);\n return (transaction ?? null) as PurchaseIOS | null;\n};\n\n/**\n * Begin refund request for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to refund request status\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/begin-refund-request-ios}\n */\nexport const beginRefundRequestIOS: MutationField<\n 'beginRefundRequestIOS'\n> = async (sku) => {\n requireIosPlatform('beginRefundRequestIOS');\n if (!sku) {\n throw new Error('beginRefundRequestIOS requires a SKU');\n }\n const status = await ExpoIapModule.beginRefundRequestIOS(sku);\n return status ?? null;\n};\n\n/**\n * Shows the system UI for managing subscriptions.\n * Returns an array of subscriptions that had status changes after the UI is closed.\n *\n * @returns Promise<Purchase[]> - Array of subscriptions with status changes (e.g., auto-renewal toggled)\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/show-manage-subscriptions-ios}\n */\nexport const showManageSubscriptionsIOS: MutationField<\n 'showManageSubscriptionsIOS'\n> = async () => {\n requireIosPlatform('showManageSubscriptionsIOS');\n const purchases = await ExpoIapModule.showManageSubscriptionsIOS();\n return (purchases ?? []) as PurchaseIOS[];\n};\n\n/**\n * Get the receipt data from the iOS device.\n * This returns the base64 encoded receipt data which can be sent to your server\n * for verification with Apple's server.\n *\n * NOTE: For proper security, always verify receipts on your server using\n * Apple's verifyReceipt endpoint, not directly from the app.\n *\n * @returns {Promise<string>} Base64 encoded receipt data\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-receipt-data-ios}\n */\nexport const getReceiptDataIOS: QueryField<'getReceiptDataIOS'> = async () => {\n requireIosPlatform('getReceiptDataIOS');\n return ExpoIapModule.getReceiptDataIOS();\n};\n\nexport const getReceiptIOS = getReceiptDataIOS;\n\n/**\n * Get the current App Store storefront country code on iOS.\n *\n * @deprecated Use cross-platform `getStorefront` from the main index instead.\n * The native module exposes a single `getStorefront` AsyncFunction that already\n * resolves to the iOS storefront on iOS. This helper is kept as an iOS-only\n * alias so consumers who previously imported `getStorefrontIOS` do not break.\n *\n * @returns {Promise<string>} ISO 3166-1 alpha-3 country code (e.g. \"USA\")\n * @throws Error if called on non-iOS platform — Android callers must use the\n * cross-platform `getStorefront` from the main index instead\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-storefront-ios}\n */\nexport const getStorefrontIOS: QueryField<'getStorefrontIOS'> = async () => {\n requireIosPlatform('getStorefrontIOS');\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: 'ios',\n });\n }\n\n let storefront: unknown;\n try {\n storefront = await ExpoIapModule.getStorefront();\n } catch (error) {\n throw createPurchaseErrorFromNativeException(error, 'ios', {\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: 'ios',\n });\n }\n return storefront;\n};\n\n/**\n * Refresh the receipt data from Apple's servers and return the updated receipt.\n * This calls AppStore.sync() before reading the receipt, ensuring the latest\n * receipt data is available. Use this after a first purchase when\n * getReceiptDataIOS() may return an empty string because the receipt file\n * has not yet been written to disk.\n *\n * @returns {Promise<string>} Base64 encoded receipt data\n *\n * @platform iOS\n */\nexport const requestReceiptRefreshIOS = async (): Promise<string> => {\n requireIosPlatform('requestReceiptRefreshIOS');\n return ExpoIapModule.requestReceiptRefreshIOS();\n};\n\n/**\n * Check if a transaction is verified through StoreKit 2.\n * StoreKit 2 performs local verification of transaction JWS signatures.\n *\n * @param sku The product's SKU (on iOS)\n * @returns Promise resolving to true if the transaction is verified\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/is-transaction-verified-ios}\n */\nexport const isTransactionVerifiedIOS: QueryField<\n 'isTransactionVerifiedIOS'\n> = async (sku) => {\n requireIosPlatform('isTransactionVerifiedIOS');\n if (!sku) {\n throw new Error('isTransactionVerifiedIOS requires a SKU');\n }\n return ExpoIapModule.isTransactionVerifiedIOS(sku);\n};\n\n/**\n * Get the JWS representation of a purchase for server-side verification.\n * The JWS (JSON Web Signature) can be verified on your server using Apple's public keys.\n *\n * @param sku The product's SKU (on iOS)\n * @returns Promise resolving to JWS representation of the transaction\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-transaction-jws-ios}\n */\nexport const getTransactionJwsIOS: QueryField<'getTransactionJwsIOS'> = async (\n sku,\n) => {\n requireIosPlatform('getTransactionJwsIOS');\n if (!sku) {\n throw new Error('getTransactionJwsIOS requires a SKU');\n }\n const jws = await ExpoIapModule.getTransactionJwsIOS(sku);\n return jws ?? '';\n};\n\n/**\n * Validate receipt for iOS using StoreKit 2's built-in verification.\n * Returns receipt data and verification information to help with server-side validation.\n *\n * NOTE: For proper security, Apple recommends verifying receipts on your server using\n * the verifyReceipt endpoint rather than relying solely on client-side verification.\n *\n * @deprecated Use verifyPurchase instead\n * @param props The product's SKU or verification props\n * @returns {Promise<{\n * isValid: boolean;\n * receiptData: string;\n * jwsRepresentation: string;\n * latestTransaction?: Purchase;\n * }>}\n *\n * @see {@link https://openiap.dev/docs/apis/ios/validate-receipt-ios}\n */\nconst validateReceiptIOSImpl = async (props: VerifyPurchaseProps | string) => {\n requireIosPlatform('validateReceiptIOS');\n const sku =\n typeof props === 'string'\n ? props\n : (props as VerifyPurchaseProps)?.apple?.sku;\n\n if (!sku) {\n throw new Error('validateReceiptIOS requires a SKU (via apple.sku)');\n }\n\n return (await ExpoIapModule.validateReceiptIOS(\n sku,\n )) as VerifyPurchaseResultIOS;\n};\n\nexport const validateReceiptIOS =\n validateReceiptIOSImpl as QueryField<'validateReceiptIOS'>;\n\n/**\n * Present the code redemption sheet for offer codes (iOS only).\n * This allows users to redeem promotional codes for in-app purchases and subscriptions.\n *\n * Note: This only works on real devices, not simulators.\n *\n * @returns Promise resolving to true if the sheet was presented successfully\n * @throws Error if called on non-iOS platform or tvOS\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/present-code-redemption-sheet-ios}\n */\nexport const presentCodeRedemptionSheetIOS: MutationField<\n 'presentCodeRedemptionSheetIOS'\n> = async () => {\n requireIosPlatform('presentCodeRedemptionSheetIOS');\n return !!(await ExpoIapModule.presentCodeRedemptionSheetIOS());\n};\n\n/**\n * Get app transaction information (iOS 16.0+).\n * AppTransaction represents the initial purchase that unlocked the app.\n *\n * NOTE: This function requires:\n * - iOS 16.0 or later at runtime\n * - Xcode 15.0+ with iOS 16.0 SDK for compilation\n *\n * @returns Promise resolving to the app transaction information or null if not available\n * @throws Error if called on non-iOS platform, iOS version < 16.0, or compiled with older SDK\n *\n * @platform iOS\n * @since iOS 16.0\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-app-transaction-ios}\n */\nexport const getAppTransactionIOS: QueryField<\n 'getAppTransactionIOS'\n> = async () => {\n requireIosPlatform('getAppTransactionIOS');\n return (await ExpoIapModule.getAppTransactionIOS()) ?? null;\n};\n\n/**\n * Get information about a promoted product if one is available (iOS only).\n * Promoted products are products that the App Store promotes on your behalf.\n * This is called after a promoted product event is received from the App Store.\n *\n * @returns Promise resolving to the promoted product information or null if none available\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-promoted-product-ios}\n */\nexport const getPromotedProductIOS: QueryField<\n 'getPromotedProductIOS'\n> = async () => {\n requireIosPlatform('getPromotedProductIOS');\n const product = await ExpoIapModule.getPromotedProductIOS();\n return (product ?? null) as ProductIOS | null;\n};\n\n/**\n * Complete the purchase of a promoted product (iOS only).\n * This should be called after showing your purchase UI for a promoted product.\n *\n * @deprecated Use promotedProductListenerIOS to receive the productId,\n * then call requestPurchase with that SKU instead.\n *\n * @returns Promise resolving when the purchase is initiated\n * @throws Error if called on non-iOS platform or no promoted product is available\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/request-purchase-on-promoted-product-ios}\n */\nexport const requestPurchaseOnPromotedProductIOS: MutationField<\n 'requestPurchaseOnPromotedProductIOS'\n> = async () => {\n requireIosPlatform('requestPurchaseOnPromotedProductIOS');\n const result = await ExpoIapModule.requestPurchaseOnPromotedProductIOS();\n return result ?? true;\n};\n\n/**\n * Get pending transactions that haven't been finished yet (iOS only).\n *\n * @returns Promise resolving to array of pending transactions\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-pending-transactions-ios}\n */\nexport const getPendingTransactionsIOS: QueryField<\n 'getPendingTransactionsIOS'\n> = async () => {\n requireIosPlatform('getPendingTransactionsIOS');\n const transactions = await ExpoIapModule.getPendingTransactionsIOS();\n return (transactions ?? []) as PurchaseIOS[];\n};\n\n/**\n * List every StoreKit transaction (finished + unfinished) for the current user.\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-all-transactions-ios}\n */\nexport const getAllTransactionsIOS: QueryField<\n 'getAllTransactionsIOS'\n> = async () => {\n requireIosPlatform('getAllTransactionsIOS');\n const transactions = await ExpoIapModule.getAllTransactionsIOS();\n return (transactions ?? []) as PurchaseIOS[];\n};\n\n/**\n * Clear a specific transaction (iOS only).\n *\n * @returns Promise resolving when transaction is cleared\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/clear-transaction-ios}\n */\nexport const clearTransactionIOS: MutationField<\n 'clearTransactionIOS'\n> = async () => {\n requireIosPlatform('clearTransactionIOS');\n return !!(await ExpoIapModule.clearTransactionIOS());\n};\n\n/**\n * Deep link to subscriptions screen on iOS.\n * @returns {Promise<void>}\n *\n * @platform iOS\n */\nexport const deepLinkToSubscriptionsIOS = (): Promise<void> =>\n Linking.openURL('https://apps.apple.com/account/subscriptions');\n\n/**\n * Check if the device can present an external purchase notice sheet (iOS 17.4+).\n *\n * Wraps `ExternalPurchase.canPresent`, which Apple introduced in iOS 17.4.\n * Note: the notice sheet itself (`presentExternalPurchaseNoticeSheetIOS`)\n * still requires iOS 18.2+; only the eligibility check is available earlier.\n *\n * @returns Promise resolving to true if the notice sheet can be presented\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/can-present-external-purchase-notice-ios}\n */\nexport const canPresentExternalPurchaseNoticeIOS: QueryField<\n 'canPresentExternalPurchaseNoticeIOS'\n> = async () => {\n requireIosPlatform('canPresentExternalPurchaseNoticeIOS');\n return !!(await ExpoIapModule.canPresentExternalPurchaseNoticeIOS());\n};\n\n/**\n * Present an external purchase notice sheet to inform users about external purchases (iOS 15.4+).\n * This must be called before opening an external purchase link.\n * Returns the external purchase token when user continues.\n *\n * @returns Promise resolving to the result with action, token, and error if any\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/present-external-purchase-notice-sheet-ios}\n */\nexport const presentExternalPurchaseNoticeSheetIOS: MutationField<\n 'presentExternalPurchaseNoticeSheetIOS'\n> = async () => {\n requireIosPlatform('presentExternalPurchaseNoticeSheetIOS');\n const result = await ExpoIapModule.presentExternalPurchaseNoticeSheetIOS();\n return result as ExternalPurchaseNoticeResultIOS;\n};\n\n/**\n * Present an external purchase link to redirect users to your website (iOS 16.0+).\n *\n * @param url - The external purchase URL to open\n * @returns Promise resolving to the result with success status and error if any\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/present-external-purchase-link-ios}\n */\nexport const presentExternalPurchaseLinkIOS: MutationField<\n 'presentExternalPurchaseLinkIOS'\n> = async (url: string) => {\n requireIosPlatform('presentExternalPurchaseLinkIOS');\n const result = await ExpoIapModule.presentExternalPurchaseLinkIOS(url);\n return result as ExternalPurchaseLinkResultIOS;\n};\n\n/**\n * Check if app is eligible for ExternalPurchaseCustomLink API (iOS 18.1+).\n * Returns true if the app can use custom external purchase links.\n *\n * @returns Promise resolving to true if eligible\n * @platform iOS\n * @see https://developer.apple.com/documentation/storekit/externalpurchasecustomlink/iseligible\n *\n * @see {@link https://openiap.dev/docs/apis/ios/is-eligible-for-external-purchase-custom-link-ios}\n */\nexport const isEligibleForExternalPurchaseCustomLinkIOS: QueryField<\n 'isEligibleForExternalPurchaseCustomLinkIOS'\n> = async () => {\n requireIosPlatform('isEligibleForExternalPurchaseCustomLinkIOS');\n return !!(await ExpoIapModule.isEligibleForExternalPurchaseCustomLinkIOS());\n};\n\n/**\n * Get external purchase token for reporting to Apple (iOS 18.1+).\n * Use this token with Apple's External Purchase Server API to report transactions.\n *\n * @param tokenType - Token type: 'acquisition' (new customers) or 'services' (existing customers)\n * @returns Promise resolving to the token result with token string or error\n * @platform iOS\n * @see https://developer.apple.com/documentation/storekit/externalpurchasecustomlink/token(for:)\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-external-purchase-custom-link-token-ios}\n */\nexport const getExternalPurchaseCustomLinkTokenIOS: QueryField<\n 'getExternalPurchaseCustomLinkTokenIOS'\n> = async (tokenType) => {\n requireIosPlatform('getExternalPurchaseCustomLinkTokenIOS');\n if (!tokenType) {\n throw new Error(\n \"getExternalPurchaseCustomLinkTokenIOS requires a tokenType ('acquisition' or 'services')\",\n );\n }\n const result = await ExpoIapModule.getExternalPurchaseCustomLinkTokenIOS(\n tokenType,\n );\n return result as ExternalPurchaseCustomLinkTokenResultIOS;\n};\n\n/**\n * Show ExternalPurchaseCustomLink notice sheet (iOS 18.1+).\n * Displays the system disclosure notice sheet for custom external purchase links.\n * Call this after a deliberate customer interaction before linking out to external purchases.\n *\n * @param noticeType - Notice type: 'browser' (external purchases displayed in browser)\n * @returns Promise resolving to the result with continued status and error if any\n * @platform iOS\n * @see https://developer.apple.com/documentation/storekit/externalpurchasecustomlink/shownotice(type:)\n *\n * @see {@link https://openiap.dev/docs/apis/ios/show-external-purchase-custom-link-notice-ios}\n */\nexport const showExternalPurchaseCustomLinkNoticeIOS: MutationField<\n 'showExternalPurchaseCustomLinkNoticeIOS'\n> = async (noticeType) => {\n requireIosPlatform('showExternalPurchaseCustomLinkNoticeIOS');\n if (!noticeType) {\n throw new Error(\n \"showExternalPurchaseCustomLinkNoticeIOS requires a noticeType ('browser')\",\n );\n }\n const result = await ExpoIapModule.showExternalPurchaseCustomLinkNoticeIOS(\n noticeType,\n );\n return result as ExternalPurchaseCustomLinkNoticeResultIOS;\n};\n\n// iOS-specific APIs only; cross-platform wrappers live in src/index.ts\n"]}
1
+ {"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/modules/ios.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,mBAAmB;AACnB,mEAAmE;AACnE,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AAiBnC,OAAO,EACL,mBAAmB,EACnB,sCAAsC,GAEvC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,CAAC,UAAkB,EAAQ,EAAE;IACtD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,2BAA2B,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC,CAAC;AAOF,YAAY;AAEZ,cAAc;AACd,MAAM,UAAU,YAAY,CAC1B,IAAa;IAEb,OAAO,CACL,IAAI,IAAI,IAAI;QACZ,OAAO,IAAI,KAAK,QAAQ;QACxB,UAAU,IAAI,IAAI;QAClB,OAAQ,IAAY,CAAC,QAAQ,KAAK,QAAQ;QACzC,IAAY,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,KAAK,CAC/C,CAAC;AACJ,CAAC;AAED,YAAY;AACZ;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,OAAO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AC,MAAM,aAAa,CAAC,0CAA0C,EAAE,CAAC,CAAC;AAC9E,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAE9C,KAAK,EAAE,SAAS,EAAE,EAAE;IACtB,kBAAkB,CAAC,uCAAuC,CAAC,CAAC;IAC5D,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,qCAAqC,CACtE,SAAS,CACV,CAAC;IACF,OAAO,MAAkD,CAAC;AAC5D,CAAC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAEhD,KAAK,EAAE,UAAU,EAAE,EAAE;IACvB,kBAAkB,CAAC,yCAAyC,CAAC,CAAC;IAC9D,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,2EAA2E,CAC5E,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,uCAAuC,CACxE,UAAU,CACX,CAAC;IACF,OAAO,MAAmD,CAAC;AAC7D,CAAC,CAAC;AAEF,uEAAuE","sourcesContent":["// External dependencies\n\n// Internal modules\n// import removed: use purchaseUpdatedListener directly in app code\nimport ExpoIapModule from '../ExpoIapModule';\nimport {ErrorCode} from '../types';\n\n// Types\nimport type {\n ExternalPurchaseCustomLinkNoticeResultIOS,\n ExternalPurchaseCustomLinkTokenResultIOS,\n ExternalPurchaseLinkResultIOS,\n ExternalPurchaseNoticeResultIOS,\n MutationField,\n ProductIOS,\n Purchase,\n PurchaseIOS,\n QueryField,\n VerifyPurchaseProps,\n VerifyPurchaseResultIOS,\n SubscriptionStatusIOS,\n} from '../types';\nimport {\n createPurchaseError,\n createPurchaseErrorFromNativeException,\n type PurchaseError,\n} from '../utils/errorMapping';\nimport {Linking, Platform} from 'react-native';\n\n/**\n * Enforce the documented iOS-only contract. Without this, calling a\n * suffixed wrapper on another platform falls through to the native proxy\n * and surfaces as an opaque `TypeError: ExpoIapModule.<name> is not a\n * function` instead of the promised platform error.\n */\nconst requireIosPlatform = (methodName: string): void => {\n if (Platform.OS !== 'ios') {\n throw new Error(`${methodName} is only available on iOS`);\n }\n};\n\nexport type TransactionEvent = {\n transaction?: Purchase;\n error?: PurchaseError;\n};\n\n// Listeners\n\n// Type guards\nexport function isProductIOS<T extends {platform?: string}>(\n item: unknown,\n): item is T & {platform: 'ios'} {\n return (\n item != null &&\n typeof item === 'object' &&\n 'platform' in item &&\n typeof (item as any).platform === 'string' &&\n (item as any).platform.toLowerCase() === 'ios'\n );\n}\n\n// Functions\n/**\n * Sync state with Appstore (iOS only)\n * https://developer.apple.com/documentation/storekit/appstore/3791906-sync\n *\n * @returns Promise resolving to null on success\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/sync-ios}\n */\nexport const syncIOS: MutationField<'syncIOS'> = async () => {\n requireIosPlatform('syncIOS');\n return !!(await ExpoIapModule.syncIOS());\n};\n\n/**\n * Check if user is eligible for introductory offer\n *\n * @param groupId - The subscription group ID\n * @returns Promise resolving to true if eligible\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/is-eligible-for-intro-offer-ios}\n */\nexport const isEligibleForIntroOfferIOS: QueryField<\n 'isEligibleForIntroOfferIOS'\n> = async (groupId) => {\n requireIosPlatform('isEligibleForIntroOfferIOS');\n if (!groupId) {\n throw new Error('isEligibleForIntroOfferIOS requires a groupId');\n }\n return ExpoIapModule.isEligibleForIntroOfferIOS(groupId);\n};\n\n/**\n * Get subscription status for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to array of subscription status\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/subscription-status-ios}\n */\nexport const subscriptionStatusIOS: QueryField<\n 'subscriptionStatusIOS'\n> = async (sku) => {\n requireIosPlatform('subscriptionStatusIOS');\n if (!sku) {\n throw new Error('subscriptionStatusIOS requires a SKU');\n }\n const status = await ExpoIapModule.subscriptionStatusIOS(sku);\n return (status ?? []) as SubscriptionStatusIOS[];\n};\n\n/**\n * Get current entitlement for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to current entitlement\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/current-entitlement-ios}\n */\nexport const currentEntitlementIOS: QueryField<\n 'currentEntitlementIOS'\n> = async (sku) => {\n requireIosPlatform('currentEntitlementIOS');\n if (!sku) {\n throw new Error('currentEntitlementIOS requires a SKU');\n }\n const purchase = await ExpoIapModule.currentEntitlementIOS(sku);\n return (purchase ?? null) as PurchaseIOS | null;\n};\n\n/**\n * Get latest transaction for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to latest transaction\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/latest-transaction-ios}\n */\nexport const latestTransactionIOS: QueryField<'latestTransactionIOS'> = async (\n sku,\n) => {\n requireIosPlatform('latestTransactionIOS');\n if (!sku) {\n throw new Error('latestTransactionIOS requires a SKU');\n }\n const transaction = await ExpoIapModule.latestTransactionIOS(sku);\n return (transaction ?? null) as PurchaseIOS | null;\n};\n\n/**\n * Begin refund request for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to refund request status\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/begin-refund-request-ios}\n */\nexport const beginRefundRequestIOS: MutationField<\n 'beginRefundRequestIOS'\n> = async (sku) => {\n requireIosPlatform('beginRefundRequestIOS');\n if (!sku) {\n throw new Error('beginRefundRequestIOS requires a SKU');\n }\n const status = await ExpoIapModule.beginRefundRequestIOS(sku);\n return status ?? null;\n};\n\n/**\n * Shows the system UI for managing subscriptions.\n * Returns an array of subscriptions that had status changes after the UI is closed.\n *\n * @returns Promise<Purchase[]> - Array of subscriptions with status changes (e.g., auto-renewal toggled)\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/show-manage-subscriptions-ios}\n */\nexport const showManageSubscriptionsIOS: MutationField<\n 'showManageSubscriptionsIOS'\n> = async () => {\n requireIosPlatform('showManageSubscriptionsIOS');\n const purchases = await ExpoIapModule.showManageSubscriptionsIOS();\n return (purchases ?? []) as PurchaseIOS[];\n};\n\n/**\n * Get the receipt data from the iOS device.\n * This returns the base64 encoded receipt data which can be sent to your server\n * for verification with Apple's server.\n *\n * NOTE: For proper security, always verify receipts on your server using\n * Apple's verifyReceipt endpoint, not directly from the app.\n *\n * @returns {Promise<string>} Base64 encoded receipt data\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-receipt-data-ios}\n */\nexport const getReceiptDataIOS: QueryField<'getReceiptDataIOS'> = async () => {\n requireIosPlatform('getReceiptDataIOS');\n return ExpoIapModule.getReceiptDataIOS();\n};\n\n/**\n * @deprecated Use `getReceiptDataIOS` instead. This compatibility alias will\n * be removed in expo-iap 5.0.0.\n */\nexport const getReceiptIOS = getReceiptDataIOS;\n\n/**\n * Get the current App Store storefront country code on iOS.\n *\n * @deprecated Use cross-platform `getStorefront` from the main index instead.\n * This compatibility alias will be removed in expo-iap 5.0.0.\n *\n * @returns {Promise<string>} ISO 3166-1 alpha-3 country code (e.g. \"USA\")\n * @throws Error if called on non-iOS platform — Android callers must use the\n * cross-platform `getStorefront` from the main index instead\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-storefront-ios}\n */\nexport const getStorefrontIOS: QueryField<'getStorefrontIOS'> = async () => {\n requireIosPlatform('getStorefrontIOS');\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: 'ios',\n });\n }\n\n let storefront: unknown;\n try {\n storefront = await ExpoIapModule.getStorefront();\n } catch (error) {\n throw createPurchaseErrorFromNativeException(error, 'ios', {\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: 'ios',\n });\n }\n return storefront;\n};\n\n/**\n * Refresh the receipt data from Apple's servers and return the updated receipt.\n * This calls AppStore.sync() before reading the receipt, ensuring the latest\n * receipt data is available. Use this after a first purchase when\n * getReceiptDataIOS() may return an empty string because the receipt file\n * has not yet been written to disk.\n *\n * @returns {Promise<string>} Base64 encoded receipt data\n *\n * @platform iOS\n */\nexport const requestReceiptRefreshIOS = async (): Promise<string> => {\n requireIosPlatform('requestReceiptRefreshIOS');\n return ExpoIapModule.requestReceiptRefreshIOS();\n};\n\n/**\n * Check if a transaction is verified through StoreKit 2.\n * StoreKit 2 performs local verification of transaction JWS signatures.\n *\n * @param sku The product's SKU (on iOS)\n * @returns Promise resolving to true if the transaction is verified\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/is-transaction-verified-ios}\n */\nexport const isTransactionVerifiedIOS: QueryField<\n 'isTransactionVerifiedIOS'\n> = async (sku) => {\n requireIosPlatform('isTransactionVerifiedIOS');\n if (!sku) {\n throw new Error('isTransactionVerifiedIOS requires a SKU');\n }\n return ExpoIapModule.isTransactionVerifiedIOS(sku);\n};\n\n/**\n * Get the JWS representation of a purchase for server-side verification.\n * The JWS (JSON Web Signature) can be verified on your server using Apple's public keys.\n *\n * @param sku The product's SKU (on iOS)\n * @returns Promise resolving to JWS representation of the transaction\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-transaction-jws-ios}\n */\nexport const getTransactionJwsIOS: QueryField<'getTransactionJwsIOS'> = async (\n sku,\n) => {\n requireIosPlatform('getTransactionJwsIOS');\n if (!sku) {\n throw new Error('getTransactionJwsIOS requires a SKU');\n }\n const jws = await ExpoIapModule.getTransactionJwsIOS(sku);\n return jws ?? '';\n};\n\nconst validateReceiptIOSImpl = async (props: VerifyPurchaseProps | string) => {\n requireIosPlatform('validateReceiptIOS');\n const sku =\n typeof props === 'string'\n ? props\n : (props as VerifyPurchaseProps)?.apple?.sku;\n\n if (!sku) {\n throw new Error('validateReceiptIOS requires a SKU (via apple.sku)');\n }\n\n return (await ExpoIapModule.validateReceiptIOS(\n sku,\n )) as VerifyPurchaseResultIOS;\n};\n\n/**\n * Validate receipt for iOS using StoreKit 2's built-in verification.\n * Returns receipt data and verification information to help with server-side validation.\n *\n * NOTE: For proper security, Apple recommends verifying receipts on your server using\n * the verifyReceipt endpoint rather than relying solely on client-side verification.\n *\n * @deprecated Use `verifyPurchase` instead. Scheduled for removal in\n * expo-iap 5.0.0.\n * @param props The product's SKU or verification props\n * @returns {Promise<{\n * isValid: boolean;\n * receiptData: string;\n * jwsRepresentation: string;\n * latestTransaction?: Purchase;\n * }>}\n *\n * @see {@link https://openiap.dev/docs/apis/ios/validate-receipt-ios}\n */\nexport const validateReceiptIOS =\n validateReceiptIOSImpl as QueryField<'validateReceiptIOS'>;\n\n/**\n * Present the code redemption sheet for offer codes (iOS only).\n * This allows users to redeem promotional codes for in-app purchases and subscriptions.\n *\n * Note: This only works on real devices, not simulators.\n *\n * @returns Promise resolving to true if the sheet was presented successfully\n * @throws Error if called on non-iOS platform or tvOS\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/present-code-redemption-sheet-ios}\n */\nexport const presentCodeRedemptionSheetIOS: MutationField<\n 'presentCodeRedemptionSheetIOS'\n> = async () => {\n requireIosPlatform('presentCodeRedemptionSheetIOS');\n return !!(await ExpoIapModule.presentCodeRedemptionSheetIOS());\n};\n\n/**\n * Get app transaction information (iOS 16.0+).\n * AppTransaction represents the initial purchase that unlocked the app.\n *\n * NOTE: This function requires:\n * - iOS 16.0 or later at runtime\n * - Xcode 15.0+ with iOS 16.0 SDK for compilation\n *\n * @returns Promise resolving to the app transaction information or null if not available\n * @throws Error if called on non-iOS platform, iOS version < 16.0, or compiled with older SDK\n *\n * @platform iOS\n * @since iOS 16.0\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-app-transaction-ios}\n */\nexport const getAppTransactionIOS: QueryField<\n 'getAppTransactionIOS'\n> = async () => {\n requireIosPlatform('getAppTransactionIOS');\n return (await ExpoIapModule.getAppTransactionIOS()) ?? null;\n};\n\n/**\n * Get information about a promoted product if one is available (iOS only).\n * Promoted products are products that the App Store promotes on your behalf.\n * This is called after a promoted product event is received from the App Store.\n *\n * @returns Promise resolving to the promoted product information or null if none available\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-promoted-product-ios}\n */\nexport const getPromotedProductIOS: QueryField<\n 'getPromotedProductIOS'\n> = async () => {\n requireIosPlatform('getPromotedProductIOS');\n const product = await ExpoIapModule.getPromotedProductIOS();\n return (product ?? null) as ProductIOS | null;\n};\n\n/**\n * Complete the purchase of a promoted product (iOS only).\n * This should be called after showing your purchase UI for a promoted product.\n *\n * @deprecated Use promotedProductListenerIOS to receive the productId, then\n * call requestPurchase with that SKU instead. This function will be removed in\n * expo-iap 5.0.0.\n *\n * @returns Promise resolving when the purchase is initiated\n * @throws Error if called on non-iOS platform or no promoted product is available\n *\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/request-purchase-on-promoted-product-ios}\n */\nexport const requestPurchaseOnPromotedProductIOS: MutationField<\n 'requestPurchaseOnPromotedProductIOS'\n> = async () => {\n requireIosPlatform('requestPurchaseOnPromotedProductIOS');\n const result = await ExpoIapModule.requestPurchaseOnPromotedProductIOS();\n return result ?? true;\n};\n\n/**\n * Get pending transactions that haven't been finished yet (iOS only).\n *\n * @returns Promise resolving to array of pending transactions\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-pending-transactions-ios}\n */\nexport const getPendingTransactionsIOS: QueryField<\n 'getPendingTransactionsIOS'\n> = async () => {\n requireIosPlatform('getPendingTransactionsIOS');\n const transactions = await ExpoIapModule.getPendingTransactionsIOS();\n return (transactions ?? []) as PurchaseIOS[];\n};\n\n/**\n * List every StoreKit transaction (finished + unfinished) for the current user.\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-all-transactions-ios}\n */\nexport const getAllTransactionsIOS: QueryField<\n 'getAllTransactionsIOS'\n> = async () => {\n requireIosPlatform('getAllTransactionsIOS');\n const transactions = await ExpoIapModule.getAllTransactionsIOS();\n return (transactions ?? []) as PurchaseIOS[];\n};\n\n/**\n * Clear a specific transaction (iOS only).\n *\n * @returns Promise resolving when transaction is cleared\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/clear-transaction-ios}\n */\nexport const clearTransactionIOS: MutationField<\n 'clearTransactionIOS'\n> = async () => {\n requireIosPlatform('clearTransactionIOS');\n return !!(await ExpoIapModule.clearTransactionIOS());\n};\n\n/**\n * Deep link to subscriptions screen on iOS.\n * @returns {Promise<void>}\n *\n * @platform iOS\n */\nexport const deepLinkToSubscriptionsIOS = (): Promise<void> =>\n Linking.openURL('https://apps.apple.com/account/subscriptions');\n\n/**\n * Check if the device can present an external purchase notice sheet (iOS 17.4+).\n *\n * Wraps `ExternalPurchase.canPresent`, which Apple introduced in iOS 17.4.\n * Note: the notice sheet itself (`presentExternalPurchaseNoticeSheetIOS`)\n * still requires iOS 18.2+; only the eligibility check is available earlier.\n *\n * @returns Promise resolving to true if the notice sheet can be presented\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/can-present-external-purchase-notice-ios}\n */\nexport const canPresentExternalPurchaseNoticeIOS: QueryField<\n 'canPresentExternalPurchaseNoticeIOS'\n> = async () => {\n requireIosPlatform('canPresentExternalPurchaseNoticeIOS');\n return !!(await ExpoIapModule.canPresentExternalPurchaseNoticeIOS());\n};\n\n/**\n * Present an external purchase notice sheet to inform users about external purchases (iOS 15.4+).\n * This must be called before opening an external purchase link.\n * Returns the external purchase token when user continues.\n *\n * @returns Promise resolving to the result with action, token, and error if any\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/present-external-purchase-notice-sheet-ios}\n */\nexport const presentExternalPurchaseNoticeSheetIOS: MutationField<\n 'presentExternalPurchaseNoticeSheetIOS'\n> = async () => {\n requireIosPlatform('presentExternalPurchaseNoticeSheetIOS');\n const result = await ExpoIapModule.presentExternalPurchaseNoticeSheetIOS();\n return result as ExternalPurchaseNoticeResultIOS;\n};\n\n/**\n * Present an external purchase link to redirect users to your website (iOS 16.0+).\n *\n * @param url - The external purchase URL to open\n * @returns Promise resolving to the result with success status and error if any\n * @platform iOS\n *\n * @see {@link https://openiap.dev/docs/apis/ios/present-external-purchase-link-ios}\n */\nexport const presentExternalPurchaseLinkIOS: MutationField<\n 'presentExternalPurchaseLinkIOS'\n> = async (url: string) => {\n requireIosPlatform('presentExternalPurchaseLinkIOS');\n const result = await ExpoIapModule.presentExternalPurchaseLinkIOS(url);\n return result as ExternalPurchaseLinkResultIOS;\n};\n\n/**\n * Check if app is eligible for ExternalPurchaseCustomLink API (iOS 18.1+).\n * Returns true if the app can use custom external purchase links.\n *\n * @returns Promise resolving to true if eligible\n * @platform iOS\n * @see https://developer.apple.com/documentation/storekit/externalpurchasecustomlink/iseligible\n *\n * @see {@link https://openiap.dev/docs/apis/ios/is-eligible-for-external-purchase-custom-link-ios}\n */\nexport const isEligibleForExternalPurchaseCustomLinkIOS: QueryField<\n 'isEligibleForExternalPurchaseCustomLinkIOS'\n> = async () => {\n requireIosPlatform('isEligibleForExternalPurchaseCustomLinkIOS');\n return !!(await ExpoIapModule.isEligibleForExternalPurchaseCustomLinkIOS());\n};\n\n/**\n * Get external purchase token for reporting to Apple (iOS 18.1+).\n * Use this token with Apple's External Purchase Server API to report transactions.\n *\n * @param tokenType - Token type: 'acquisition' (new customers) or 'services' (existing customers)\n * @returns Promise resolving to the token result with token string or error\n * @platform iOS\n * @see https://developer.apple.com/documentation/storekit/externalpurchasecustomlink/token(for:)\n *\n * @see {@link https://openiap.dev/docs/apis/ios/get-external-purchase-custom-link-token-ios}\n */\nexport const getExternalPurchaseCustomLinkTokenIOS: QueryField<\n 'getExternalPurchaseCustomLinkTokenIOS'\n> = async (tokenType) => {\n requireIosPlatform('getExternalPurchaseCustomLinkTokenIOS');\n if (!tokenType) {\n throw new Error(\n \"getExternalPurchaseCustomLinkTokenIOS requires a tokenType ('acquisition' or 'services')\",\n );\n }\n const result = await ExpoIapModule.getExternalPurchaseCustomLinkTokenIOS(\n tokenType,\n );\n return result as ExternalPurchaseCustomLinkTokenResultIOS;\n};\n\n/**\n * Show ExternalPurchaseCustomLink notice sheet (iOS 18.1+).\n * Displays the system disclosure notice sheet for custom external purchase links.\n * Call this after a deliberate customer interaction before linking out to external purchases.\n *\n * @param noticeType - Notice type: 'browser' (external purchases displayed in browser)\n * @returns Promise resolving to the result with continued status and error if any\n * @platform iOS\n * @see https://developer.apple.com/documentation/storekit/externalpurchasecustomlink/shownotice(type:)\n *\n * @see {@link https://openiap.dev/docs/apis/ios/show-external-purchase-custom-link-notice-ios}\n */\nexport const showExternalPurchaseCustomLinkNoticeIOS: MutationField<\n 'showExternalPurchaseCustomLinkNoticeIOS'\n> = async (noticeType) => {\n requireIosPlatform('showExternalPurchaseCustomLinkNoticeIOS');\n if (!noticeType) {\n throw new Error(\n \"showExternalPurchaseCustomLinkNoticeIOS requires a noticeType ('browser')\",\n );\n }\n const result = await ExpoIapModule.showExternalPurchaseCustomLinkNoticeIOS(\n noticeType,\n );\n return result as ExternalPurchaseCustomLinkNoticeResultIOS;\n};\n\n// iOS-specific APIs only; cross-platform wrappers live in src/index.ts\n"]}