expo-iap 2.7.1 → 2.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.
@@ -167,10 +167,15 @@ export declare const presentCodeRedemptionSheetIOS: () => Promise<boolean>;
167
167
  * Get app transaction information (iOS 16.0+).
168
168
  * AppTransaction represents the initial purchase that unlocked the app.
169
169
  *
170
+ * NOTE: This function requires:
171
+ * - iOS 16.0 or later at runtime
172
+ * - Xcode 15.0+ with iOS 16.0 SDK for compilation
173
+ *
170
174
  * @returns Promise resolving to the app transaction information or null if not available
171
- * @throws Error if called on non-iOS platform or iOS version < 16.0
175
+ * @throws Error if called on non-iOS platform, iOS version < 16.0, or compiled with older SDK
172
176
  *
173
177
  * @platform iOS
178
+ * @since iOS 16.0
174
179
  */
175
180
  export declare const getAppTransactionIOS: () => Promise<AppTransactionIOS | null>;
176
181
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../src/modules/ios.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,eAAe,EACf,aAAa,EAGd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAGF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI;;CAkC5C,CAAC;AAGF,wBAAgB,YAAY,CAAC,CAAC,SAAS;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAC,EACxD,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,CAAC,GAAG;IAAC,QAAQ,EAAE,KAAK,CAAA;CAAC,CAO/B;AAGD;;;;;;;;GAQG;AACH,eAAO,MAAM,O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BAAkB,GAC7B,KAAK,MAAM,KACV,OAAO,CAAC,gBAAgB,EAAE,CAK5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,OAAO,CAAC,eAAe,CAKvE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,KAAG,OAAO,CAAC,eAAe,CAKtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,KAAK,MAAM,KACV,OAAO,CAAC,mBAAmB,CAK7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAO,OAAO,CAAC,IAAI,CAKtD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,OAAO,CAAC,MAAM,CAK9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,KAAG,OAAO,CAAC,OAAO,CAKlE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,KAAG,OAAO,CAAC,MAAM,CAK7D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,KAAK,MAAM,KACV,OAAO,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,eAAe,CAAC;CACrC,CAKA,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,QAAO,OAAO,CAAC,OAAO,CAK5D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAO,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAKpE,CAAC"}
@@ -203,10 +203,15 @@ export const presentCodeRedemptionSheetIOS = () => {
203
203
  * Get app transaction information (iOS 16.0+).
204
204
  * AppTransaction represents the initial purchase that unlocked the app.
205
205
  *
206
+ * NOTE: This function requires:
207
+ * - iOS 16.0 or later at runtime
208
+ * - Xcode 15.0+ with iOS 16.0 SDK for compilation
209
+ *
206
210
  * @returns Promise resolving to the app transaction information or null if not available
207
- * @throws Error if called on non-iOS platform or iOS version < 16.0
211
+ * @throws Error if called on non-iOS platform, iOS version < 16.0, or compiled with older SDK
208
212
  *
209
213
  * @platform iOS
214
+ * @since iOS 16.0
210
215
  */
211
216
  export const getAppTransactionIOS = () => {
212
217
  return ExpoIapModule.getAppTransaction();
@@ -1 +1 @@
1
- {"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/modules/ios.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,mBAAmB;AACnB,OAAO,EAAC,uBAAuB,EAAC,MAAM,IAAI,CAAC;AAC3C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAmB7C,YAAY;AACZ;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,QAA2C,EAC3C,EAAE;IACF,MAAM,iBAAiB,GAAG,CAAC,IAAa,EAA2B,EAAE;QACnE,OAAO,CACL,IAAI,IAAI,IAAI;YACZ,OAAO,IAAI,KAAK,QAAQ;YACxB,IAAI,IAAI,IAAI;YACZ,eAAe,IAAI,IAAI;YACvB,UAAU,IAAI,IAAI,CACnB,CAAC;IACJ,CAAC,CAAC;IAEF,iEAAiE;IACjE,MAAM,6BAA6B,GAAG,CACpC,QAAyC,EACvB,EAAE;QACpB,8CAA8C;QAC9C,IAAI,iBAAiB,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChC,OAAO;gBACL,WAAW,EAAE,QAA2B;aACzC,CAAC;QACJ,CAAC;QAED,sDAAsD;QACtD,OAAO;YACL,WAAW,EAAE,QAA2B;SACzC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,uBAAuB,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC1C,yEAAyE;QACzE,MAAM,KAAK,GAAG,6BAA6B,CAAC,QAAQ,CAAC,CAAC;QACtD,QAAQ,CAAC,KA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,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAW,EAAoB,EAAE;IACrE,OAAO,CAAC,IAAI,CACV,gIAAgI,CACjI,CAAC;IACF,OAAO,wBAAwB,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAAmB,EAAE;IAChE,OAAO,CAAC,IAAI,CACV,wHAAwH,CACzH,CAAC;IACF,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,GAAW,EAMV,EAAE;IACH,OAAO,CAAC,IAAI,CACV,uHAAuH,CACxH,CAAC;IACF,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAqB,EAAE;IAC/D,OAAO,CAAC,IAAI,CACV,0IAA0I,CAC3I,CAAC;IACF,OAAO,6BAA6B,EAAE,CAAC;AACzC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAsC,EAAE;IACvE,OAAO,CAAC,IAAI,CACV,wHAAwH,CACzH,CAAC;IACF,OAAO,oBAAoB,EAAE,CAAC;AAChC,CAAC,CAAC","sourcesContent":["// External dependencies\n\n// Internal modules\nimport {purchaseUpdatedListener} from '..';\nimport ExpoIapModule from '../ExpoIapModule';\n\n// Types\nimport {\n ProductPurchase,\n PurchaseError,\n Purchase,\n SubscriptionPurchase,\n} from '../ExpoIap.types';\nimport type {\n ProductStatusIos,\n AppTransactionIOS,\n} from '../types/ExpoIapIos.types';\n\nexport type TransactionEvent = {\n transaction?: ProductPurchase;\n error?: PurchaseError;\n};\n\n// Listeners\n/**\n * @deprecated Use `purchaseUpdatedListener` instead. This function will be removed in a future version.\n *\n * The `transactionUpdatedIos` function is redundant as it simply wraps `purchaseUpdatedListener`.\n * You can achieve the same functionality by using `purchaseUpdatedListener` directly.\n *\n * @example\n * // Instead of:\n * // transactionUpdatedIos((event) => { ... });\n *\n * // Use:\n * // purchaseUpdatedListener((purchase) => { ... });\n */\nexport const transactionUpdatedIos = (\n listener: (event: TransactionEvent) => void,\n) => {\n const isProductPurchase = (item: unknown): item is ProductPurchase => {\n return (\n item != null &&\n typeof item === 'object' &&\n 'id' in item &&\n 'transactionId' in item &&\n 'platform' in item\n );\n };\n\n // Helper function to safely convert Purchase to TransactionEvent\n const mapPurchaseToTransactionEvent = (\n purchase: Purchase | SubscriptionPurchase,\n ): TransactionEvent => {\n // Validate the purchase object before casting\n if (isProductPurchase(purchase)) {\n return {\n transaction: purchase as ProductPurchase,\n };\n }\n\n // Fallback: create a basic TransactionEvent structure\n return {\n transaction: purchase as ProductPurchase,\n };\n };\n\n return purchaseUpdatedListener((purchase) => {\n // Convert Purchase to TransactionEvent format for backward compatibility\n const event = mapPurchaseToTransactionEvent(purchase);\n listener(event);\n });\n};\n\n// Type guards\nexport function isProductIos<T extends {platform?: string}>(\n item: unknown,\n): item is T & {platform: 'ios'} {\n return (\n item != null &&\n typeof item === 'object' &&\n 'platform' in item &&\n item.platform === 'ios'\n );\n}\n\n// Functions\n/**\n * Sync state with Appstore (iOS only)\n * https://developer.apple.com/documentation/storekit/appstore/3791906-sync\n *\n * @returns Promise resolving to null on success\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const syncIOS = (): Promise<null> => {\n return ExpoIapModule.sync();\n};\n\n/**\n * Check if user is eligible for introductory offer\n *\n * @param groupID The subscription group ID\n * @returns Promise resolving to true if eligible\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const isEligibleForIntroOfferIOS = (\n groupID: string,\n): Promise<boolean> => {\n return ExpoIapModule.isEligibleForIntroOffer(groupID);\n};\n\n/**\n * Get subscription status for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to array of subscription status\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const subscriptionStatusIOS = (\n sku: string,\n): Promise<ProductStatusIos[]> => {\n return ExpoIapModule.subscriptionStatus(sku);\n};\n\n/**\n * Get current entitlement for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to current entitlement\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const currentEntitlementIOS = (\n sku: string,\n): Promise<ProductPurchase> => {\n return ExpoIapModule.currentEntitlement(sku);\n};\n\n/**\n * Get latest transaction for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to latest transaction\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const latestTransactionIOS = (sku: string): Promise<ProductPurchase> => {\n return ExpoIapModule.latestTransaction(sku);\n};\n\n/**\n * Begin refund request for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to refund request status\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\ntype RefundRequestStatus = 'success' | 'userCancelled';\nexport const beginRefundRequestIOS = (\n sku: string,\n): Promise<RefundRequestStatus> => {\n return ExpoIapModule.beginRefundRequest(sku);\n};\n\n/**\n * Shows the system UI for managing subscriptions.\n * When the user changes subscription renewal status, the system will emit events to\n * purchaseUpdatedListener and transactionUpdatedIos listeners.\n *\n * @returns Promise resolving to null on success\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const showManageSubscriptionsIOS = (): Promise<null> => {\n return ExpoIapModule.showManageSubscriptions();\n};\n\n/**\n * Get the receipt data from the iOS device.\n * This returns the base64 encoded receipt data which can be sent to your server\n * for verification with Apple's server.\n *\n * NOTE: For proper security, always verify receipts on your server using\n * Apple's verifyReceipt endpoint, not directly from the app.\n *\n * @returns {Promise<string>} Base64 encoded receipt data\n */\nexport const getReceiptIOS = (): Promise<string> => {\n return ExpoIapModule.getReceiptData();\n};\n\n/**\n * Check if a transaction is verified through StoreKit 2.\n * StoreKit 2 performs local verification of transaction JWS signatures.\n *\n * @param sku The product's SKU (on iOS)\n * @returns Promise resolving to true if the transaction is verified\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const isTransactionVerifiedIOS = (sku: string): Promise<boolean> => {\n return ExpoIapModule.isTransactionVerified(sku);\n};\n\n/**\n * Get the JWS representation of a purchase for server-side verification.\n * The JWS (JSON Web Signature) can be verified on your server using Apple's public keys.\n *\n * @param sku The product's SKU (on iOS)\n * @returns Promise resolving to JWS representation of the transaction\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const getTransactionJwsIOS = (sku: string): Promise<string> => {\n return ExpoIapModule.getTransactionJws(sku);\n};\n\n/**\n * Validate receipt for iOS using StoreKit 2's built-in verification.\n * Returns receipt data and verification information to help with server-side validation.\n *\n * NOTE: For proper security, Apple recommends verifying receipts on your server using\n * the verifyReceipt endpoint rather than relying solely on client-side verification.\n *\n * @param {string} sku The product's SKU (on iOS)\n * @returns {Promise<{\n * isValid: boolean;\n * receiptData: string;\n * jwsRepresentation: string;\n * latestTransaction?: ProductPurchase;\n * }>}\n */\nexport const validateReceiptIOS = async (\n sku: string,\n): Promise<{\n isValid: boolean;\n receiptData: string;\n jwsRepresentation: string;\n latestTransaction?: ProductPurchase;\n}> => {\n const result = await ExpoIapModule.validateReceiptIOS(sku);\n return result;\n};\n\n/**\n * Present the code redemption sheet for offer codes (iOS only).\n * This allows users to redeem promotional codes for in-app purchases and subscriptions.\n *\n * Note: This only works on real devices, not simulators.\n *\n * @returns Promise resolving to true if the sheet was presented successfully\n * @throws Error if called on non-iOS platform or tvOS\n *\n * @platform iOS\n */\nexport const presentCodeRedemptionSheetIOS = (): Promise<boolean> => {\n return ExpoIapModule.presentCodeRedemptionSheet();\n};\n\n/**\n * Get app transaction information (iOS 16.0+).\n * AppTransaction represents the initial purchase that unlocked the app.\n *\n * @returns Promise resolving to the app transaction information or null if not available\n * @throws Error if called on non-iOS platform or iOS version < 16.0\n *\n * @platform iOS\n */\nexport const getAppTransactionIOS = (): Promise<AppTransactionIOS | null> => {\n return ExpoIapModule.getAppTransaction();\n};\n\n// ============= DEPRECATED FUNCTIONS =============\n// These will be removed in version 3.0.0\n\n/**\n * @deprecated Use `syncIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const sync = (): Promise<null> => {\n console.warn(\n '`sync` is deprecated. Use `syncIOS` instead. This function will be removed in version 3.0.0.',\n );\n return syncIOS();\n};\n\n/**\n * @deprecated Use `isEligibleForIntroOfferIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const isEligibleForIntroOffer = (groupID: string): Promise<boolean> => {\n console.warn(\n '`isEligibleForIntroOffer` is deprecated. Use `isEligibleForIntroOfferIOS` instead. This function will be removed in version 3.0.0.',\n );\n return isEligibleForIntroOfferIOS(groupID);\n};\n\n/**\n * @deprecated Use `subscriptionStatusIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const subscriptionStatus = (\n sku: string,\n): Promise<ProductStatusIos[]> => {\n console.warn(\n '`subscriptionStatus` is deprecated. Use `subscriptionStatusIOS` instead. This function will be removed in version 3.0.0.',\n );\n return subscriptionStatusIOS(sku);\n};\n\n/**\n * @deprecated Use `currentEntitlementIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const currentEntitlement = (sku: string): Promise<ProductPurchase> => {\n console.warn(\n '`currentEntitlement` is deprecated. Use `currentEntitlementIOS` instead. This function will be removed in version 3.0.0.',\n );\n return currentEntitlementIOS(sku);\n};\n\n/**\n * @deprecated Use `latestTransactionIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const latestTransaction = (sku: string): Promise<ProductPurchase> => {\n console.warn(\n '`latestTransaction` is deprecated. Use `latestTransactionIOS` instead. This function will be removed in version 3.0.0.',\n );\n return latestTransactionIOS(sku);\n};\n\n/**\n * @deprecated Use `beginRefundRequestIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const beginRefundRequest = (\n sku: string,\n): Promise<RefundRequestStatus> => {\n console.warn(\n '`beginRefundRequest` is deprecated. Use `beginRefundRequestIOS` instead. This function will be removed in version 3.0.0.',\n );\n return beginRefundRequestIOS(sku);\n};\n\n/**\n * @deprecated Use `showManageSubscriptionsIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const showManageSubscriptions = (): Promise<null> => {\n console.warn(\n '`showManageSubscriptions` is deprecated. Use `showManageSubscriptionsIOS` instead. This function will be removed in version 3.0.0.',\n );\n return showManageSubscriptionsIOS();\n};\n\n/**\n * @deprecated Use `getReceiptIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const getReceiptIos = (): Promise<string> => {\n console.warn(\n '`getReceiptIos` is deprecated. Use `getReceiptIOS` instead. This function will be removed in version 3.0.0.',\n );\n return getReceiptIOS();\n};\n\n/**\n * @deprecated Use `isTransactionVerifiedIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const isTransactionVerified = (sku: string): Promise<boolean> => {\n console.warn(\n '`isTransactionVerified` is deprecated. Use `isTransactionVerifiedIOS` instead. This function will be removed in version 3.0.0.',\n );\n return isTransactionVerifiedIOS(sku);\n};\n\n/**\n * @deprecated Use `getTransactionJwsIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const getTransactionJws = (sku: string): Promise<string> => {\n console.warn(\n '`getTransactionJws` is deprecated. Use `getTransactionJwsIOS` instead. This function will be removed in version 3.0.0.',\n );\n return getTransactionJwsIOS(sku);\n};\n\n/**\n * @deprecated Use `validateReceiptIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const validateReceiptIos = async (\n sku: string,\n): Promise<{\n isValid: boolean;\n receiptData: string;\n jwsRepresentation: string;\n latestTransaction?: ProductPurchase;\n}> => {\n console.warn(\n '`validateReceiptIos` is deprecated. Use `validateReceiptIOS` instead. This function will be removed in version 3.0.0.',\n );\n return validateReceiptIOS(sku);\n};\n\n/**\n * @deprecated Use `presentCodeRedemptionSheetIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const presentCodeRedemptionSheet = (): Promise<boolean> => {\n console.warn(\n '`presentCodeRedemptionSheet` is deprecated. Use `presentCodeRedemptionSheetIOS` instead. This function will be removed in version 3.0.0.',\n );\n return presentCodeRedemptionSheetIOS();\n};\n\n/**\n * @deprecated Use `getAppTransactionIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const getAppTransaction = (): Promise<AppTransactionIOS | null> => {\n console.warn(\n '`getAppTransaction` is deprecated. Use `getAppTransactionIOS` instead. This function will be removed in version 3.0.0.',\n );\n return getAppTransactionIOS();\n};\n"]}
1
+ {"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/modules/ios.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,mBAAmB;AACnB,OAAO,EAAC,uBAAuB,EAAC,MAAM,IAAI,CAAC;AAC3C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAmB7C,YAAY;AACZ;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,QAA2C,EAC3C,EAAE;IACF,MAAM,iBAAiB,GAAG,CAAC,IAAa,EAA2B,EAAE;QACnE,OAAO,CACL,IAAI,IAAI,IAAI;YACZ,OAAO,IAAI,KAAK,QAAQ;YACxB,IAAI,IAAI,IAAI;YACZ,eAAe,IAAI,IAAI;YACvB,UAAU,IAAI,IAAI,CACnB,CAAC;IACJ,CAAC,CAAC;IAEF,iEAAiE;IACjE,MAAM,6BAA6B,GAAG,CACpC,QAAyC,EACvB,EAAE;QACpB,8CAA8C;QAC9C,IAAI,iBAAiB,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChC,OAAO;gBACL,WAAW,EAAE,QAA2B;aACzC,CAAC;QACJ,CAAC;QAED,sDAAsD;QACtD,OAAO;YACL,WAAW,EAAE,QAA2B;SACzC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,uBAAuB,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC1C,yEAAyE;QACzE,MAAM,KAAK,GAAG,6BAA6B,CAAC,QAAQ,CAAC,CAAC;QACtD,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC,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AAqB,GAAG,CAAC,GAAW,EAAoB,EAAE;IACrE,OAAO,CAAC,IAAI,CACV,gIAAgI,CACjI,CAAC;IACF,OAAO,wBAAwB,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAAmB,EAAE;IAChE,OAAO,CAAC,IAAI,CACV,wHAAwH,CACzH,CAAC;IACF,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,GAAW,EAMV,EAAE;IACH,OAAO,CAAC,IAAI,CACV,uHAAuH,CACxH,CAAC;IACF,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAqB,EAAE;IAC/D,OAAO,CAAC,IAAI,CACV,0IAA0I,CAC3I,CAAC;IACF,OAAO,6BAA6B,EAAE,CAAC;AACzC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAsC,EAAE;IACvE,OAAO,CAAC,IAAI,CACV,wHAAwH,CACzH,CAAC;IACF,OAAO,oBAAoB,EAAE,CAAC;AAChC,CAAC,CAAC","sourcesContent":["// External dependencies\n\n// Internal modules\nimport {purchaseUpdatedListener} from '..';\nimport ExpoIapModule from '../ExpoIapModule';\n\n// Types\nimport {\n ProductPurchase,\n PurchaseError,\n Purchase,\n SubscriptionPurchase,\n} from '../ExpoIap.types';\nimport type {\n ProductStatusIos,\n AppTransactionIOS,\n} from '../types/ExpoIapIos.types';\n\nexport type TransactionEvent = {\n transaction?: ProductPurchase;\n error?: PurchaseError;\n};\n\n// Listeners\n/**\n * @deprecated Use `purchaseUpdatedListener` instead. This function will be removed in a future version.\n *\n * The `transactionUpdatedIos` function is redundant as it simply wraps `purchaseUpdatedListener`.\n * You can achieve the same functionality by using `purchaseUpdatedListener` directly.\n *\n * @example\n * // Instead of:\n * // transactionUpdatedIos((event) => { ... });\n *\n * // Use:\n * // purchaseUpdatedListener((purchase) => { ... });\n */\nexport const transactionUpdatedIos = (\n listener: (event: TransactionEvent) => void,\n) => {\n const isProductPurchase = (item: unknown): item is ProductPurchase => {\n return (\n item != null &&\n typeof item === 'object' &&\n 'id' in item &&\n 'transactionId' in item &&\n 'platform' in item\n );\n };\n\n // Helper function to safely convert Purchase to TransactionEvent\n const mapPurchaseToTransactionEvent = (\n purchase: Purchase | SubscriptionPurchase,\n ): TransactionEvent => {\n // Validate the purchase object before casting\n if (isProductPurchase(purchase)) {\n return {\n transaction: purchase as ProductPurchase,\n };\n }\n\n // Fallback: create a basic TransactionEvent structure\n return {\n transaction: purchase as ProductPurchase,\n };\n };\n\n return purchaseUpdatedListener((purchase) => {\n // Convert Purchase to TransactionEvent format for backward compatibility\n const event = mapPurchaseToTransactionEvent(purchase);\n listener(event);\n });\n};\n\n// Type guards\nexport function isProductIos<T extends {platform?: string}>(\n item: unknown,\n): item is T & {platform: 'ios'} {\n return (\n item != null &&\n typeof item === 'object' &&\n 'platform' in item &&\n item.platform === 'ios'\n );\n}\n\n// Functions\n/**\n * Sync state with Appstore (iOS only)\n * https://developer.apple.com/documentation/storekit/appstore/3791906-sync\n *\n * @returns Promise resolving to null on success\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const syncIOS = (): Promise<null> => {\n return ExpoIapModule.sync();\n};\n\n/**\n * Check if user is eligible for introductory offer\n *\n * @param groupID The subscription group ID\n * @returns Promise resolving to true if eligible\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const isEligibleForIntroOfferIOS = (\n groupID: string,\n): Promise<boolean> => {\n return ExpoIapModule.isEligibleForIntroOffer(groupID);\n};\n\n/**\n * Get subscription status for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to array of subscription status\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const subscriptionStatusIOS = (\n sku: string,\n): Promise<ProductStatusIos[]> => {\n return ExpoIapModule.subscriptionStatus(sku);\n};\n\n/**\n * Get current entitlement for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to current entitlement\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const currentEntitlementIOS = (\n sku: string,\n): Promise<ProductPurchase> => {\n return ExpoIapModule.currentEntitlement(sku);\n};\n\n/**\n * Get latest transaction for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to latest transaction\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const latestTransactionIOS = (sku: string): Promise<ProductPurchase> => {\n return ExpoIapModule.latestTransaction(sku);\n};\n\n/**\n * Begin refund request for a specific SKU\n *\n * @param sku The product SKU\n * @returns Promise resolving to refund request status\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\ntype RefundRequestStatus = 'success' | 'userCancelled';\nexport const beginRefundRequestIOS = (\n sku: string,\n): Promise<RefundRequestStatus> => {\n return ExpoIapModule.beginRefundRequest(sku);\n};\n\n/**\n * Shows the system UI for managing subscriptions.\n * When the user changes subscription renewal status, the system will emit events to\n * purchaseUpdatedListener and transactionUpdatedIos listeners.\n *\n * @returns Promise resolving to null on success\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const showManageSubscriptionsIOS = (): Promise<null> => {\n return ExpoIapModule.showManageSubscriptions();\n};\n\n/**\n * Get the receipt data from the iOS device.\n * This returns the base64 encoded receipt data which can be sent to your server\n * for verification with Apple's server.\n *\n * NOTE: For proper security, always verify receipts on your server using\n * Apple's verifyReceipt endpoint, not directly from the app.\n *\n * @returns {Promise<string>} Base64 encoded receipt data\n */\nexport const getReceiptIOS = (): Promise<string> => {\n return ExpoIapModule.getReceiptData();\n};\n\n/**\n * Check if a transaction is verified through StoreKit 2.\n * StoreKit 2 performs local verification of transaction JWS signatures.\n *\n * @param sku The product's SKU (on iOS)\n * @returns Promise resolving to true if the transaction is verified\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const isTransactionVerifiedIOS = (sku: string): Promise<boolean> => {\n return ExpoIapModule.isTransactionVerified(sku);\n};\n\n/**\n * Get the JWS representation of a purchase for server-side verification.\n * The JWS (JSON Web Signature) can be verified on your server using Apple's public keys.\n *\n * @param sku The product's SKU (on iOS)\n * @returns Promise resolving to JWS representation of the transaction\n * @throws Error if called on non-iOS platform\n *\n * @platform iOS\n */\nexport const getTransactionJwsIOS = (sku: string): Promise<string> => {\n return ExpoIapModule.getTransactionJws(sku);\n};\n\n/**\n * Validate receipt for iOS using StoreKit 2's built-in verification.\n * Returns receipt data and verification information to help with server-side validation.\n *\n * NOTE: For proper security, Apple recommends verifying receipts on your server using\n * the verifyReceipt endpoint rather than relying solely on client-side verification.\n *\n * @param {string} sku The product's SKU (on iOS)\n * @returns {Promise<{\n * isValid: boolean;\n * receiptData: string;\n * jwsRepresentation: string;\n * latestTransaction?: ProductPurchase;\n * }>}\n */\nexport const validateReceiptIOS = async (\n sku: string,\n): Promise<{\n isValid: boolean;\n receiptData: string;\n jwsRepresentation: string;\n latestTransaction?: ProductPurchase;\n}> => {\n const result = await ExpoIapModule.validateReceiptIOS(sku);\n return result;\n};\n\n/**\n * Present the code redemption sheet for offer codes (iOS only).\n * This allows users to redeem promotional codes for in-app purchases and subscriptions.\n *\n * Note: This only works on real devices, not simulators.\n *\n * @returns Promise resolving to true if the sheet was presented successfully\n * @throws Error if called on non-iOS platform or tvOS\n *\n * @platform iOS\n */\nexport const presentCodeRedemptionSheetIOS = (): Promise<boolean> => {\n return ExpoIapModule.presentCodeRedemptionSheet();\n};\n\n/**\n * Get app transaction information (iOS 16.0+).\n * AppTransaction represents the initial purchase that unlocked the app.\n *\n * NOTE: This function requires:\n * - iOS 16.0 or later at runtime\n * - Xcode 15.0+ with iOS 16.0 SDK for compilation\n *\n * @returns Promise resolving to the app transaction information or null if not available\n * @throws Error if called on non-iOS platform, iOS version < 16.0, or compiled with older SDK\n *\n * @platform iOS\n * @since iOS 16.0\n */\nexport const getAppTransactionIOS = (): Promise<AppTransactionIOS | null> => {\n return ExpoIapModule.getAppTransaction();\n};\n\n// ============= DEPRECATED FUNCTIONS =============\n// These will be removed in version 3.0.0\n\n/**\n * @deprecated Use `syncIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const sync = (): Promise<null> => {\n console.warn(\n '`sync` is deprecated. Use `syncIOS` instead. This function will be removed in version 3.0.0.',\n );\n return syncIOS();\n};\n\n/**\n * @deprecated Use `isEligibleForIntroOfferIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const isEligibleForIntroOffer = (groupID: string): Promise<boolean> => {\n console.warn(\n '`isEligibleForIntroOffer` is deprecated. Use `isEligibleForIntroOfferIOS` instead. This function will be removed in version 3.0.0.',\n );\n return isEligibleForIntroOfferIOS(groupID);\n};\n\n/**\n * @deprecated Use `subscriptionStatusIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const subscriptionStatus = (\n sku: string,\n): Promise<ProductStatusIos[]> => {\n console.warn(\n '`subscriptionStatus` is deprecated. Use `subscriptionStatusIOS` instead. This function will be removed in version 3.0.0.',\n );\n return subscriptionStatusIOS(sku);\n};\n\n/**\n * @deprecated Use `currentEntitlementIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const currentEntitlement = (sku: string): Promise<ProductPurchase> => {\n console.warn(\n '`currentEntitlement` is deprecated. Use `currentEntitlementIOS` instead. This function will be removed in version 3.0.0.',\n );\n return currentEntitlementIOS(sku);\n};\n\n/**\n * @deprecated Use `latestTransactionIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const latestTransaction = (sku: string): Promise<ProductPurchase> => {\n console.warn(\n '`latestTransaction` is deprecated. Use `latestTransactionIOS` instead. This function will be removed in version 3.0.0.',\n );\n return latestTransactionIOS(sku);\n};\n\n/**\n * @deprecated Use `beginRefundRequestIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const beginRefundRequest = (\n sku: string,\n): Promise<RefundRequestStatus> => {\n console.warn(\n '`beginRefundRequest` is deprecated. Use `beginRefundRequestIOS` instead. This function will be removed in version 3.0.0.',\n );\n return beginRefundRequestIOS(sku);\n};\n\n/**\n * @deprecated Use `showManageSubscriptionsIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const showManageSubscriptions = (): Promise<null> => {\n console.warn(\n '`showManageSubscriptions` is deprecated. Use `showManageSubscriptionsIOS` instead. This function will be removed in version 3.0.0.',\n );\n return showManageSubscriptionsIOS();\n};\n\n/**\n * @deprecated Use `getReceiptIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const getReceiptIos = (): Promise<string> => {\n console.warn(\n '`getReceiptIos` is deprecated. Use `getReceiptIOS` instead. This function will be removed in version 3.0.0.',\n );\n return getReceiptIOS();\n};\n\n/**\n * @deprecated Use `isTransactionVerifiedIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const isTransactionVerified = (sku: string): Promise<boolean> => {\n console.warn(\n '`isTransactionVerified` is deprecated. Use `isTransactionVerifiedIOS` instead. This function will be removed in version 3.0.0.',\n );\n return isTransactionVerifiedIOS(sku);\n};\n\n/**\n * @deprecated Use `getTransactionJwsIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const getTransactionJws = (sku: string): Promise<string> => {\n console.warn(\n '`getTransactionJws` is deprecated. Use `getTransactionJwsIOS` instead. This function will be removed in version 3.0.0.',\n );\n return getTransactionJwsIOS(sku);\n};\n\n/**\n * @deprecated Use `validateReceiptIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const validateReceiptIos = async (\n sku: string,\n): Promise<{\n isValid: boolean;\n receiptData: string;\n jwsRepresentation: string;\n latestTransaction?: ProductPurchase;\n}> => {\n console.warn(\n '`validateReceiptIos` is deprecated. Use `validateReceiptIOS` instead. This function will be removed in version 3.0.0.',\n );\n return validateReceiptIOS(sku);\n};\n\n/**\n * @deprecated Use `presentCodeRedemptionSheetIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const presentCodeRedemptionSheet = (): Promise<boolean> => {\n console.warn(\n '`presentCodeRedemptionSheet` is deprecated. Use `presentCodeRedemptionSheetIOS` instead. This function will be removed in version 3.0.0.',\n );\n return presentCodeRedemptionSheetIOS();\n};\n\n/**\n * @deprecated Use `getAppTransactionIOS` instead. This function will be removed in version 3.0.0.\n */\nexport const getAppTransaction = (): Promise<AppTransactionIOS | null> => {\n console.warn(\n '`getAppTransaction` is deprecated. Use `getAppTransactionIOS` instead. This function will be removed in version 3.0.0.',\n );\n return getAppTransactionIOS();\n};\n"]}
@@ -257,6 +257,7 @@ public class ExpoIapModule: Module {
257
257
 
258
258
  AsyncFunction("getAppTransaction") { () async throws -> [String: Any?]? in
259
259
  if #available(iOS 16.0, *) {
260
+ #if compiler(>=5.7)
260
261
  let verificationResult = try await AppTransaction.shared
261
262
 
262
263
  let appTransaction: AppTransaction
@@ -287,6 +288,13 @@ public class ExpoIapModule: Module {
287
288
  }
288
289
 
289
290
  return result
291
+ #else
292
+ throw Exception(
293
+ name: "ExpoIapModule",
294
+ description: "getAppTransaction requires Xcode 15.0+ with iOS 16.0 SDK for compilation",
295
+ code: IapErrorCode.unknown
296
+ )
297
+ #endif
290
298
  } else {
291
299
  throw Exception(
292
300
  name: "ExpoIapModule",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-iap",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "description": "In App Purchase module in Expo",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -274,10 +274,15 @@ export const presentCodeRedemptionSheetIOS = (): Promise<boolean> => {
274
274
  * Get app transaction information (iOS 16.0+).
275
275
  * AppTransaction represents the initial purchase that unlocked the app.
276
276
  *
277
+ * NOTE: This function requires:
278
+ * - iOS 16.0 or later at runtime
279
+ * - Xcode 15.0+ with iOS 16.0 SDK for compilation
280
+ *
277
281
  * @returns Promise resolving to the app transaction information or null if not available
278
- * @throws Error if called on non-iOS platform or iOS version < 16.0
282
+ * @throws Error if called on non-iOS platform, iOS version < 16.0, or compiled with older SDK
279
283
  *
280
284
  * @platform iOS
285
+ * @since iOS 16.0
281
286
  */
282
287
  export const getAppTransactionIOS = (): Promise<AppTransactionIOS | null> => {
283
288
  return ExpoIapModule.getAppTransaction();