expo-iap 2.7.3 → 2.7.5-rc.1

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.
@@ -1,7 +1,6 @@
1
1
  # GitHub Copilot Instructions for expo-iap
2
2
 
3
3
  ## Package Manager
4
-
5
4
  **IMPORTANT: This project uses Bun exclusively. Do not suggest npm, yarn, or pnpm commands.**
6
5
 
7
6
  - Install dependencies: `bun install`
@@ -17,9 +16,7 @@
17
16
  When suggesting code for expo-iap, follow these naming conventions:
18
17
 
19
18
  ### Platform-Specific Functions
20
-
21
19
  Functions that only work on one platform MUST have platform suffixes:
22
-
23
20
  - iOS: `functionNameIos()`
24
21
  - Android: `functionNameAndroid()`
25
22
 
@@ -31,21 +28,16 @@ export const getAppTransactionIos = async (): Promise<AppTransactionIOS | null>
31
28
  ```
32
29
 
33
30
  ### Cross-Platform Functions
34
-
35
31
  Functions that abstract platform differences don't need suffixes:
36
32
 
37
33
  ```typescript
38
34
  // Correct cross-platform example:
39
35
  export const getProducts = async (skus: string[]): Promise<Product[]> => {
40
36
  return Platform.select({
41
- ios: async () => {
42
- /* iOS implementation */
43
- },
44
- android: async () => {
45
- /* Android implementation */
46
- },
37
+ ios: async () => { /* iOS implementation */ },
38
+ android: async () => { /* Android implementation */ },
47
39
  })();
48
- };
40
+ }
49
41
  ```
50
42
 
51
43
  ## Project Overview
@@ -201,7 +193,6 @@ const handleSubscription = async (subscriptionId: string) => {
201
193
  ## Code Suggestions
202
194
 
203
195
  When generating code:
204
-
205
196
  1. Check if the function is platform-specific
206
197
  2. Add appropriate suffix if it only works on one platform
207
198
  3. Use Platform.select() for cross-platform implementations
@@ -210,9 +201,7 @@ When generating code:
210
201
  6. Add JSDoc comments for public APIs
211
202
 
212
203
  ## Testing
213
-
214
204
  Suggest tests that:
215
-
216
205
  - Cover both iOS and Android paths
217
206
  - Use `bun test` commands
218
207
  - Include platform mocking when needed
@@ -221,19 +210,12 @@ Suggest tests that:
221
210
  ## Common Patterns
222
211
 
223
212
  ### Platform Selection
224
-
225
213
  ```typescript
226
214
  Platform.select({
227
- ios: () => {
228
- /* iOS code */
229
- },
230
- android: () => {
231
- /* Android code */
232
- },
233
- default: () => {
234
- /* Fallback */
235
- },
236
- });
215
+ ios: () => { /* iOS code */ },
216
+ android: () => { /* Android code */ },
217
+ default: () => { /* Fallback */ },
218
+ })
237
219
  ```
238
220
 
239
221
  ### Receipt Validation (Platform-specific parameters)
@@ -318,4 +300,4 @@ const result = await requestPurchase({
318
300
  });
319
301
  ```
320
302
 
321
- While maintaining full power and flexibility for advanced enterprise use cases.
303
+ While maintaining full power and flexibility for advanced enterprise use cases.
package/CHANGELOG.md CHANGED
@@ -1,34 +1,36 @@
1
1
  # Changelog
2
2
 
3
- ## [2.7.3] - 2025-07-23
3
+ ## [2.7.4] - 2025-07-24
4
4
 
5
5
  ### Fixed
6
+ - Add iOS 18.4+ availability check for `appTransactionID` property
7
+ - Update TypeScript type to make `appTransactionID` optional for iOS versions below 18.4
8
+ - Ensure compatibility with devices running iOS versions below 18.4
9
+
10
+ ## [2.7.3] - 2025-07-23
6
11
 
12
+ ### Fixed
7
13
  - Upgraded Android Google Play Billing Library to v8.0.0
8
14
  - Fixed Kotlin version compatibility issues with expo-modules-core
9
15
 
10
16
  ### Changed
11
-
12
17
  - Android now requires Kotlin 2.0+ for Google Play Billing Library v8.0.0 support
13
18
  - Added requirement for `expo-build-properties` configuration to override Kotlin version
14
19
 
15
20
  ### Documentation
16
-
17
21
  - Added Android configuration section in README explaining the need for expo-build-properties
18
22
  - Documented Kotlin version requirement for Android builds
19
23
 
20
24
  ## [2.7.2] - 2025-07-22
21
25
 
22
26
  ### Added
23
-
24
27
  - iOS 16.0+ app transaction support with SDK version check (#113)
25
28
 
26
29
  ## [2.7.1] - 2025-07-22
27
30
 
28
31
  ### Fixed
29
-
30
32
  - Add missing `requestProducts()` API that was discussed in PR #109 but not included in the merge
31
- - Add deprecation warnings to `getProducts()` and `getSubscriptions()`
33
+ - Add deprecation warnings to `getProducts()` and `getSubscriptions()`
32
34
  - Fix `getStorefrontIOS()` to show warning instead of throwing error on non-iOS platforms
33
35
  - Add `requestProducts` to useIap hook for consistency with other APIs
34
36
  - Fix documentation CI build failures (broken anchors, missing tags, truncation marker)
@@ -36,18 +38,15 @@
36
38
  ## [2.7.0] - 2025-07-22
37
39
 
38
40
  ### Added
39
-
40
41
  - New platform-specific API structure for `requestPurchase` with explicit `ios` and `android` parameters
41
42
  - Support for Google Play Billing Library v8.0.0
42
43
  - Automatic service reconnection on Android for improved reliability
43
44
  - Detailed sub-response error codes for better error handling
44
45
 
45
46
  ### Changed
46
-
47
47
  - Deprecated `requestSubscription` in favor of `requestPurchase` with `type: 'subs'`
48
48
  - `getPurchaseHistory` is no longer available on Android (removed in Google Play Billing v8)
49
49
 
50
50
  ### Breaking Changes
51
-
52
51
  - Android: `getPurchaseHistory()` removed - use `getAvailablePurchases()` instead
53
- - Android: Requires Google Play Billing Library v8.0.0
52
+ - Android: Requires Google Play Billing Library v8.0.0
package/CONTRIBUTING.md CHANGED
@@ -25,14 +25,12 @@ Thank you for your interest in contributing to expo-iap! This guide will help yo
25
25
  ### Installation
26
26
 
27
27
  1. Clone the repository:
28
-
29
28
  ```bash
30
29
  git clone https://github.com/hyochan/expo-iap.git
31
30
  cd expo-iap
32
31
  ```
33
32
 
34
33
  2. Install dependencies using Bun:
35
-
36
34
  ```bash
37
35
  bun install
38
36
  ```
@@ -44,7 +42,6 @@ This project includes VSCode configurations for easier development:
44
42
  1. **Install recommended extensions**: When you open the project in VSCode, you'll be prompted to install recommended extensions. Accept to install them.
45
43
 
46
44
  2. **Use Debug Configurations**: Press `F5` or go to Run → Start Debugging and select:
47
-
48
45
  - `Debug iOS (Expo)` - Runs the example app on iOS simulator
49
46
  - `Debug Android (Expo)` - Runs the example app on Android emulator
50
47
  - `iOS + Metro` - Starts Metro bundler and iOS app together
@@ -78,19 +75,16 @@ The example app is a great way to test your changes and see the library in actio
78
75
  ### Setup
79
76
 
80
77
  1. Navigate to the example directory:
81
-
82
78
  ```bash
83
79
  cd example
84
80
  ```
85
81
 
86
82
  2. Install example app dependencies:
87
-
88
83
  ```bash
89
84
  bun install
90
85
  ```
91
86
 
92
87
  3. For iOS development, install pods:
93
-
94
88
  ```bash
95
89
  cd ios
96
90
  pod install
@@ -100,31 +94,26 @@ cd ..
100
94
  ### Running the App
101
95
 
102
96
  #### iOS
103
-
104
97
  ```bash
105
98
  bun run ios
106
99
  ```
107
100
 
108
101
  Or open the project in Xcode:
109
-
110
102
  ```bash
111
103
  open ios/cpk.xcworkspace
112
104
  ```
113
105
 
114
106
  **Note**: If you encounter build errors, you may need to:
115
-
116
107
  1. Clean the build: `cd ios && xcodebuild clean`
117
108
  2. Update pods: `cd ios && pod install`
118
109
  3. Open in Xcode and build from there for better error messages
119
110
 
120
111
  #### Android
121
-
122
112
  ```bash
123
113
  bun run android
124
114
  ```
125
115
 
126
116
  Or open the project in Android Studio:
127
-
128
117
  ```bash
129
118
  open -a "Android Studio" android
130
119
  ```
@@ -134,7 +123,6 @@ open -a "Android Studio" android
134
123
  ### Development Server
135
124
 
136
125
  Start the Metro bundler:
137
-
138
126
  ```bash
139
127
  bun start
140
128
  ```
@@ -150,7 +138,7 @@ bun start
150
138
  # Run on iOS simulator
151
139
  bun run ios
152
140
 
153
- # Run on Android emulator
141
+ # Run on Android emulator
154
142
  bun run android
155
143
 
156
144
  # Run tests
@@ -226,7 +214,6 @@ bun test
226
214
  ```
227
215
 
228
216
  Run tests with coverage:
229
-
230
217
  ```bash
231
218
  bun run test:coverage
232
219
  ```
@@ -239,7 +226,6 @@ bun run test:coverage
239
226
  - Test both iOS and Android code paths
240
227
 
241
228
  Example test structure:
242
-
243
229
  ```typescript
244
230
  import { render, fireEvent } from '@testing-library/react-native';
245
231
  import MyComponent from '../MyComponent';
@@ -253,7 +239,6 @@ describe('MyComponent', () => {
253
239
  ```
254
240
 
255
241
  **Known Issues**:
256
-
257
242
  - React Native modules may need to be mocked in tests
258
243
  - Use Jest's module mocking for native dependencies
259
244
  - Some tests may fail due to native module dependencies
@@ -263,13 +248,11 @@ describe('MyComponent', () => {
263
248
  ### Linting
264
249
 
265
250
  Run linting checks:
266
-
267
251
  ```bash
268
252
  bun run lint
269
253
  ```
270
254
 
271
255
  Fix linting issues:
272
-
273
256
  ```bash
274
257
  bun run lint:eslint
275
258
  bun run lint:prettier
@@ -285,7 +268,6 @@ bun run lint:prettier
285
268
  ### Code Formatting
286
269
 
287
270
  We use Prettier for code formatting. Format your code:
288
-
289
271
  ```bash
290
272
  bun run lint:prettier
291
273
  ```
@@ -295,7 +277,6 @@ bun run lint:prettier
295
277
  ### Commit Messages
296
278
 
297
279
  Follow conventional commit format:
298
-
299
280
  ```
300
281
  type(scope): subject
301
282
 
@@ -305,7 +286,6 @@ footer
305
286
  ```
306
287
 
307
288
  Types:
308
-
309
289
  - `feat`: New feature
310
290
  - `fix`: Bug fix
311
291
  - `docs`: Documentation changes
@@ -315,7 +295,6 @@ Types:
315
295
  - `chore`: Maintenance tasks
316
296
 
317
297
  Example:
318
-
319
298
  ```
320
299
  feat(ios): add getStorefrontIos function
321
300
 
@@ -350,7 +329,6 @@ Closes #123
350
329
  ## 🐛 Reporting Issues
351
330
 
352
331
  When reporting issues, please include:
353
-
354
332
  - expo-iap version
355
333
  - React Native/Expo SDK version
356
334
  - Platform (iOS/Android)
@@ -362,7 +340,6 @@ When reporting issues, please include:
362
340
  ## 💡 Feature Requests
363
341
 
364
342
  We welcome feature requests! Please:
365
-
366
343
  - Check existing issues first
367
344
  - Provide use case and motivation
368
345
  - Consider implementation approach
@@ -375,4 +352,4 @@ We welcome feature requests! Please:
375
352
  - [Example App](./example)
376
353
  - [Platform-Specific Guidelines](./docs/PLATFORM_NAMING.md)
377
354
 
378
- Thank you for contributing to expo-iap! 🎉
355
+ Thank you for contributing to expo-iap! 🎉
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoIap.types.d.ts","sourceRoot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AsB,CACpC,KAA0E;IAE1E,OAAO,KAAK,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,KAA0E;IAE1E,OAAO,KAAK,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,KAA0E;IAE1E,OAAO,WAAW,IAAI,KAAK,IAAI,YAAY,IAAI,KAAK,CAAC;AACvD,CAAC;AAED,iFAAiF","sourcesContent":["import {\n ProductAndroid,\n ProductPurchaseAndroid,\n RequestPurchaseAndroidProps,\n RequestSubscriptionAndroidProps,\n SubscriptionProductAndroid,\n} from './types/ExpoIapAndroid.types';\nimport {\n ProductIos,\n ProductPurchaseIos,\n RequestPurchaseIosProps,\n RequestSubscriptionIosProps,\n SubscriptionProductIos,\n} from './types/ExpoIapIos.types';\nimport {NATIVE_ERROR_CODES} from './ExpoIapModule';\n\nexport type ChangeEventPayload = {\n value: string;\n};\n\nexport type ProductType = 'inapp' | 'subs';\n\nexport type ProductBase = {\n id: string;\n title: string;\n description: string;\n type: ProductType;\n displayName?: string;\n displayPrice: string;\n currency: string;\n price?: number;\n};\n\nexport type PurchaseBase = {\n id: string;\n transactionId?: string;\n transactionDate: number;\n transactionReceipt: string;\n};\n\n// Define literal platform types for better type discrimination\nexport type IosPlatform = {platform: 'ios'};\nexport type AndroidPlatform = {platform: 'android'};\n\n// Platform-agnostic unified product types (public API)\nexport type Product =\n | (ProductAndroid & AndroidPlatform)\n | (ProductIos & IosPlatform);\n\nexport type SubscriptionProduct =\n | (SubscriptionProductAndroid & AndroidPlatform)\n | (SubscriptionProductIos & IosPlatform);\n\n// Legacy internal platform-specific types (kept for backward compatibility)\nexport type LegacyRequestPurchaseProps =\n | RequestPurchaseIosProps\n | RequestPurchaseAndroidProps;\n\nexport type LegacyRequestSubscriptionProps =\n | RequestSubscriptionAndroidProps\n | RequestSubscriptionIosProps;\n\n// ============================================================================\n// Legacy Types (For backward compatibility with useIap hook)\n// ============================================================================\n\n// Re-export platform-specific purchase types for legacy compatibility\nexport type {ProductPurchaseAndroid} from './types/ExpoIapAndroid.types';\nexport type {ProductPurchaseIos} from './types/ExpoIapIos.types';\n\n// Union type for platform-specific purchase types (legacy support)\nexport type ProductPurchase =\n | (ProductPurchaseAndroid & AndroidPlatform)\n | (ProductPurchaseIos & IosPlatform);\n\n// Union type for platform-specific subscription purchase types (legacy support)\nexport type SubscriptionPurchase =\n | (ProductPurchaseAndroid & AndroidPlatform & {autoRenewingAndroid: boolean})\n | (ProductPurchaseIos & IosPlatform);\n\nexport type Purchase = ProductPurchase | SubscriptionPurchase;\n\n// Legacy result type\nexport type PurchaseResult = {\n responseCode?: number;\n debugMessage?: string;\n code?: string;\n message?: string;\n purchaseTokenAndroid?: string;\n};\n/**\n * Centralized error codes for expo-iap\n * These are mapped to platform-specific error codes and provide consistent error handling\n */\nexport enum ErrorCode {\n E_UNKNOWN = 'E_UNKNOWN',\n E_USER_CANCELLED = 'E_USER_CANCELLED',\n E_USER_ERROR = 'E_USER_ERROR',\n E_ITEM_UNAVAILABLE = 'E_ITEM_UNAVAILABLE',\n E_REMOTE_ERROR = 'E_REMOTE_ERROR',\n E_NETWORK_ERROR = 'E_NETWORK_ERROR',\n E_SERVICE_ERROR = 'E_SERVICE_ERROR',\n E_RECEIPT_FAILED = 'E_RECEIPT_FAILED',\n E_RECEIPT_FINISHED_FAILED = 'E_RECEIPT_FINISHED_FAILED',\n E_NOT_PREPARED = 'E_NOT_PREPARED',\n E_NOT_ENDED = 'E_NOT_ENDED',\n E_ALREADY_OWNED = 'E_ALREADY_OWNED',\n E_DEVELOPER_ERROR = 'E_DEVELOPER_ERROR',\n E_BILLING_RESPONSE_JSON_PARSE_ERROR = 'E_BILLING_RESPONSE_JSON_PARSE_ERROR',\n E_DEFERRED_PAYMENT = 'E_DEFERRED_PAYMENT',\n E_INTERRUPTED = 'E_INTERRUPTED',\n E_IAP_NOT_AVAILABLE = 'E_IAP_NOT_AVAILABLE',\n E_PURCHASE_ERROR = 'E_PURCHASE_ERROR',\n E_SYNC_ERROR = 'E_SYNC_ERROR',\n E_TRANSACTION_VALIDATION_FAILED = 'E_TRANSACTION_VALIDATION_FAILED',\n E_ACTIVITY_UNAVAILABLE = 'E_ACTIVITY_UNAVAILABLE',\n E_ALREADY_PREPARED = 'E_ALREADY_PREPARED',\n E_PENDING = 'E_PENDING',\n E_CONNECTION_CLOSED = 'E_CONNECTION_CLOSED',\n}\n\n/**\n * Platform-specific error code mappings\n * Maps ErrorCode enum values to platform-specific integer codes\n */\nexport const ErrorCodeMapping = {\n ios: {\n [ErrorCode.E_UNKNOWN]: 0,\n [ErrorCode.E_SERVICE_ERROR]: 1,\n [ErrorCode.E_USER_CANCELLED]: 2,\n [ErrorCode.E_USER_ERROR]: 3,\n [ErrorCode.E_ITEM_UNAVAILABLE]: 4,\n [ErrorCode.E_REMOTE_ERROR]: 5,\n [ErrorCode.E_NETWORK_ERROR]: 6,\n [ErrorCode.E_RECEIPT_FAILED]: 7,\n [ErrorCode.E_RECEIPT_FINISHED_FAILED]: 8,\n [ErrorCode.E_DEVELOPER_ERROR]: 9,\n [ErrorCode.E_PURCHASE_ERROR]: 10,\n [ErrorCode.E_SYNC_ERROR]: 11,\n [ErrorCode.E_DEFERRED_PAYMENT]: 12,\n [ErrorCode.E_TRANSACTION_VALIDATION_FAILED]: 13,\n [ErrorCode.E_NOT_PREPARED]: 14,\n [ErrorCode.E_NOT_ENDED]: 15,\n [ErrorCode.E_ALREADY_OWNED]: 16,\n [ErrorCode.E_BILLING_RESPONSE_JSON_PARSE_ERROR]: 17,\n [ErrorCode.E_INTERRUPTED]: 18,\n [ErrorCode.E_IAP_NOT_AVAILABLE]: 19,\n [ErrorCode.E_ACTIVITY_UNAVAILABLE]: 20,\n [ErrorCode.E_ALREADY_PREPARED]: 21,\n [ErrorCode.E_PENDING]: 22,\n [ErrorCode.E_CONNECTION_CLOSED]: 23,\n },\n android: {\n [ErrorCode.E_UNKNOWN]: 'E_UNKNOWN',\n [ErrorCode.E_USER_CANCELLED]: 'E_USER_CANCELLED',\n [ErrorCode.E_USER_ERROR]: 'E_USER_ERROR',\n [ErrorCode.E_ITEM_UNAVAILABLE]: 'E_ITEM_UNAVAILABLE',\n [ErrorCode.E_REMOTE_ERROR]: 'E_REMOTE_ERROR',\n [ErrorCode.E_NETWORK_ERROR]: 'E_NETWORK_ERROR',\n [ErrorCode.E_SERVICE_ERROR]: 'E_SERVICE_ERROR',\n [ErrorCode.E_RECEIPT_FAILED]: 'E_RECEIPT_FAILED',\n [ErrorCode.E_RECEIPT_FINISHED_FAILED]: 'E_RECEIPT_FINISHED_FAILED',\n [ErrorCode.E_NOT_PREPARED]: 'E_NOT_PREPARED',\n [ErrorCode.E_NOT_ENDED]: 'E_NOT_ENDED',\n [ErrorCode.E_ALREADY_OWNED]: 'E_ALREADY_OWNED',\n [ErrorCode.E_DEVELOPER_ERROR]: 'E_DEVELOPER_ERROR',\n [ErrorCode.E_BILLING_RESPONSE_JSON_PARSE_ERROR]:\n 'E_BILLING_RESPONSE_JSON_PARSE_ERROR',\n [ErrorCode.E_DEFERRED_PAYMENT]: 'E_DEFERRED_PAYMENT',\n [ErrorCode.E_INTERRUPTED]: 'E_INTERRUPTED',\n [ErrorCode.E_IAP_NOT_AVAILABLE]: 'E_IAP_NOT_AVAILABLE',\n [ErrorCode.E_PURCHASE_ERROR]: 'E_PURCHASE_ERROR',\n [ErrorCode.E_SYNC_ERROR]: 'E_SYNC_ERROR',\n [ErrorCode.E_TRANSACTION_VALIDATION_FAILED]:\n 'E_TRANSACTION_VALIDATION_FAILED',\n [ErrorCode.E_ACTIVITY_UNAVAILABLE]: 'E_ACTIVITY_UNAVAILABLE',\n [ErrorCode.E_ALREADY_PREPARED]: 'E_ALREADY_PREPARED',\n [ErrorCode.E_PENDING]: 'E_PENDING',\n [ErrorCode.E_CONNECTION_CLOSED]: 'E_CONNECTION_CLOSED',\n },\n} as const;\n\nexport class PurchaseError implements Error {\n constructor(\n public name: string,\n public message: string,\n public responseCode?: number,\n public debugMessage?: string,\n public code?: ErrorCode,\n public productId?: string,\n public platform?: 'ios' | 'android',\n ) {\n this.name = '[expo-iap]: PurchaseError';\n this.message = message;\n this.responseCode = responseCode;\n this.debugMessage = debugMessage;\n this.code = code;\n this.productId = productId;\n this.platform = platform;\n }\n\n /**\n * Creates a PurchaseError from platform-specific error data\n * @param errorData Raw error data from native modules\n * @param platform Platform where the error occurred\n * @returns Properly typed PurchaseError instance\n */\n static fromPlatformError(\n errorData: any,\n platform: 'ios' | 'android',\n ): PurchaseError {\n const errorCode = errorData.code\n ? ErrorCodeUtils.fromPlatformCode(errorData.code, platform)\n : ErrorCode.E_UNKNOWN;\n\n return new PurchaseError(\n '[expo-iap]: PurchaseError',\n errorData.message || 'Unknown error occurred',\n errorData.responseCode,\n errorData.debugMessage,\n errorCode,\n errorData.productId,\n platform,\n );\n }\n\n /**\n * Gets the platform-specific error code for this error\n * @returns Platform-specific error code\n */\n getPlatformCode(): string | number | undefined {\n if (!this.code || !this.platform) return undefined;\n return ErrorCodeUtils.toPlatformCode(this.code, this.platform);\n }\n}\n\n/**\n * Utility functions for error code mapping and validation\n */\nexport const ErrorCodeUtils = {\n /**\n * Gets the native error code for the current platform\n * @param errorCode ErrorCode enum value\n * @returns Platform-specific error code from native constants\n */\n getNativeErrorCode: (errorCode: ErrorCode): string => {\n return NATIVE_ERROR_CODES[errorCode] || errorCode;\n },\n\n /**\n * Maps a platform-specific error code back to the standardized ErrorCode enum\n * @param platformCode Platform-specific error code (string for Android, number for iOS)\n * @param platform Target platform\n * @returns Corresponding ErrorCode enum value or E_UNKNOWN if not found\n */\n fromPlatformCode: (\n platformCode: string | number,\n platform: 'ios' | 'android',\n ): ErrorCode => {\n const mapping = ErrorCodeMapping[platform];\n\n for (const [errorCode, mappedCode] of Object.entries(mapping)) {\n if (mappedCode === platformCode) {\n return errorCode as ErrorCode;\n }\n }\n\n return ErrorCode.E_UNKNOWN;\n },\n\n /**\n * Maps an ErrorCode enum to platform-specific code\n * @param errorCode ErrorCode enum value\n * @param platform Target platform\n * @returns Platform-specific error code\n */\n toPlatformCode: (\n errorCode: ErrorCode,\n platform: 'ios' | 'android',\n ): string | number => {\n return (\n ErrorCodeMapping[platform][errorCode] ??\n (platform === 'ios' ? 0 : 'E_UNKNOWN')\n );\n },\n\n /**\n * Checks if an error code is valid for the specified platform\n * @param errorCode ErrorCode enum value\n * @param platform Target platform\n * @returns True if the error code is supported on the platform\n */\n isValidForPlatform: (\n errorCode: ErrorCode,\n platform: 'ios' | 'android',\n ): boolean => {\n return errorCode in ErrorCodeMapping[platform];\n },\n};\n\n// ============================================================================\n// Enhanced Unified Request Types\n// ============================================================================\n\n/**\n * Unified request props that work on both iOS and Android platforms\n * iOS will use 'sku', Android will use 'skus' (or convert sku to skus array)\n */\nexport interface UnifiedRequestPurchaseProps {\n // Universal properties - works on both platforms\n readonly sku?: string; // Single SKU (iOS native, Android fallback)\n readonly skus?: string[]; // Multiple SKUs (Android native, iOS uses first item)\n\n // iOS-specific properties (ignored on Android)\n readonly andDangerouslyFinishTransactionAutomaticallyIOS?: boolean;\n readonly appAccountToken?: string;\n readonly quantity?: number;\n readonly withOffer?: import('./types/ExpoIapIos.types').PaymentDiscount;\n\n // Android-specific properties (ignored on iOS)\n readonly obfuscatedAccountIdAndroid?: string;\n readonly obfuscatedProfileIdAndroid?: string;\n readonly isOfferPersonalized?: boolean;\n}\n\n/**\n * Unified subscription request props\n */\nexport interface UnifiedRequestSubscriptionProps\n extends UnifiedRequestPurchaseProps {\n // Android subscription-specific properties\n readonly purchaseTokenAndroid?: string;\n readonly replacementModeAndroid?: number;\n readonly subscriptionOffers?: {\n sku: string;\n offerToken: string;\n }[];\n}\n\n// ============================================================================\n// New Platform-Specific Request Types (v2.7.0+)\n// ============================================================================\n\n/**\n * iOS-specific purchase request parameters\n */\nexport interface IosRequestPurchaseProps {\n readonly sku: string;\n readonly andDangerouslyFinishTransactionAutomaticallyIOS?: boolean;\n readonly appAccountToken?: string;\n readonly quantity?: number;\n readonly withOffer?: import('./types/ExpoIapIos.types').PaymentDiscount;\n}\n\n/**\n * Android-specific purchase request parameters\n */\nexport interface AndroidRequestPurchaseProps {\n readonly skus: string[];\n readonly obfuscatedAccountIdAndroid?: string;\n readonly obfuscatedProfileIdAndroid?: string;\n readonly isOfferPersonalized?: boolean;\n}\n\n/**\n * Android-specific subscription request parameters\n */\nexport interface AndroidRequestSubscriptionProps\n extends AndroidRequestPurchaseProps {\n readonly purchaseTokenAndroid?: string;\n readonly replacementModeAndroid?: number;\n readonly subscriptionOffers: {\n sku: string;\n offerToken: string;\n }[];\n}\n\n/**\n * Modern platform-specific request structure (v2.7.0+)\n * Allows clear separation of iOS and Android parameters\n */\nexport interface PlatformRequestPurchaseProps {\n readonly ios?: IosRequestPurchaseProps;\n readonly android?: AndroidRequestPurchaseProps;\n}\n\n/**\n * Modern platform-specific subscription request structure (v2.7.0+)\n */\nexport interface PlatformRequestSubscriptionProps {\n readonly ios?: IosRequestPurchaseProps;\n readonly android?: AndroidRequestSubscriptionProps;\n}\n\n/**\n * Modern request purchase parameters (v2.7.0+)\n * This is the recommended API moving forward\n */\nexport type RequestPurchaseProps = PlatformRequestPurchaseProps;\n\n/**\n * Modern request subscription parameters (v2.7.0+)\n * This is the recommended API moving forward\n */\nexport type RequestSubscriptionProps = PlatformRequestSubscriptionProps;\n\n/**\n * Legacy request purchase parameters (deprecated)\n * Includes both unified and old platform-specific formats\n * @deprecated Use RequestPurchaseProps with platform-specific structure instead\n */\nexport type LegacyRequestPurchasePropsAll =\n | UnifiedRequestPurchaseProps\n | LegacyRequestPurchaseProps;\n\n/**\n * Legacy request subscription parameters (deprecated)\n * Includes both unified and old platform-specific formats\n * @deprecated Use RequestSubscriptionProps with platform-specific structure instead\n */\nexport type LegacyRequestSubscriptionPropsAll =\n | UnifiedRequestSubscriptionProps\n | LegacyRequestSubscriptionProps;\n\n/**\n * All supported request purchase parameters\n * Used internally for backward compatibility\n * @internal\n */\nexport type RequestPurchasePropsWithLegacy =\n | RequestPurchaseProps\n | LegacyRequestPurchasePropsAll;\n\n/**\n * All supported request subscription parameters\n * Used internally for backward compatibility\n * @internal\n */\nexport type RequestSubscriptionPropsWithLegacy =\n | RequestSubscriptionProps\n | LegacyRequestSubscriptionPropsAll;\n\n// ============================================================================\n// Type Guards and Utility Functions\n// ============================================================================\n\n// Type guards to check which API style is being used\nexport function isPlatformRequestProps(\n props: RequestPurchasePropsWithLegacy | RequestSubscriptionPropsWithLegacy,\n): props is PlatformRequestPurchaseProps | PlatformRequestSubscriptionProps {\n return 'ios' in props || 'android' in props;\n}\n\nexport function isUnifiedRequestProps(\n props: RequestPurchasePropsWithLegacy | RequestSubscriptionPropsWithLegacy,\n): props is UnifiedRequestPurchaseProps | UnifiedRequestSubscriptionProps {\n return 'sku' in props || 'skus' in props;\n}\n\nexport function isLegacyRequestProps(\n props: RequestPurchasePropsWithLegacy | RequestSubscriptionPropsWithLegacy,\n): props is LegacyRequestPurchaseProps | LegacyRequestSubscriptionProps {\n return 'productId' in props || 'productIds' in props;\n}\n\n// Note: Other type guard functions are exported from index.ts to avoid conflicts\n"]}
1
+ {"version":3,"file":"ExpoIap.types.js","sourceRoot":"","sources":["../src/ExpoIap.types.ts"],"names":[],"mappings":"AAcA,OAAO,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AA4EnD;;;GAGG;AACH,MAAM,CAAN,IAAY,SAyBX;AAzBD,WAAY,SAAS;IACnB,oCAAuB,CAAA;IACvB,kDAAqC,CAAA;IACrC,0CAA6B,CAAA;IAC7B,sDAAyC,CAAA;IACzC,8CAAiC,CAAA;IACjC,gDAAmC,CAAA;IACnC,gDAAmC,CAAA;IACnC,kDAAqC,CAAA;IACrC,oEAAuD,CAAA;IACvD,8CAAiC,CAAA;IACjC,wCAA2B,CAAA;IAC3B,gDAAmC,CAAA;IACnC,oDAA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AC,CAAC,WAAW,CAAC,CACvC,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,kBAAkB,EAAE,CAClB,SAAoB,EACpB,QAA2B,EAClB,EAAE;QACX,OAAO,SAAS,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;CACF,CAAC;AAuIF,+EAA+E;AAC/E,oCAAoC;AACpC,+EAA+E;AAE/E,qDAAqD;AACrD,MAAM,UAAU,sBAAsB,CACpC,KAA0E;IAE1E,OAAO,KAAK,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,KAA0E;IAE1E,OAAO,KAAK,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,KAA0E;IAE1E,OAAO,WAAW,IAAI,KAAK,IAAI,YAAY,IAAI,KAAK,CAAC;AACvD,CAAC;AAED,iFAAiF","sourcesContent":["import {\n ProductAndroid,\n ProductPurchaseAndroid,\n RequestPurchaseAndroidProps,\n RequestSubscriptionAndroidProps,\n SubscriptionProductAndroid,\n} from './types/ExpoIapAndroid.types';\nimport {\n ProductIos,\n ProductPurchaseIos,\n RequestPurchaseIosProps,\n RequestSubscriptionIosProps,\n SubscriptionProductIos,\n} from './types/ExpoIapIos.types';\nimport {NATIVE_ERROR_CODES} from './ExpoIapModule';\n\nexport type ChangeEventPayload = {\n value: string;\n};\n\nexport type ProductType = 'inapp' | 'subs';\n\nexport type ProductBase = {\n id: string;\n title: string;\n description: string;\n type: ProductType;\n displayName?: string;\n displayPrice: string;\n currency: string;\n price?: number;\n};\n\nexport type PurchaseBase = {\n id: string;\n transactionId?: string;\n transactionDate: number;\n transactionReceipt: string;\n};\n\n// Define literal platform types for better type discrimination\nexport type IosPlatform = {platform: 'ios'};\nexport type AndroidPlatform = {platform: 'android'};\n\n// Platform-agnostic unified product types (public API)\nexport type Product =\n | (ProductAndroid & AndroidPlatform)\n | (ProductIos & IosPlatform);\n\nexport type SubscriptionProduct =\n | (SubscriptionProductAndroid & AndroidPlatform)\n | (SubscriptionProductIos & IosPlatform);\n\n// Legacy internal platform-specific types (kept for backward compatibility)\nexport type LegacyRequestPurchaseProps =\n | RequestPurchaseIosProps\n | RequestPurchaseAndroidProps;\n\nexport type LegacyRequestSubscriptionProps =\n | RequestSubscriptionAndroidProps\n | RequestSubscriptionIosProps;\n\n// ============================================================================\n// Legacy Types (For backward compatibility with useIap hook)\n// ============================================================================\n\n// Re-export platform-specific purchase types for legacy compatibility\nexport type {ProductPurchaseAndroid} from './types/ExpoIapAndroid.types';\nexport type {ProductPurchaseIos} from './types/ExpoIapIos.types';\n\n// Union type for platform-specific purchase types (legacy support)\nexport type ProductPurchase =\n | (ProductPurchaseAndroid & AndroidPlatform)\n | (ProductPurchaseIos & IosPlatform);\n\n// Union type for platform-specific subscription purchase types (legacy support)\nexport type SubscriptionPurchase =\n | (ProductPurchaseAndroid & AndroidPlatform & {autoRenewingAndroid: boolean})\n | (ProductPurchaseIos & IosPlatform);\n\nexport type Purchase = ProductPurchase | SubscriptionPurchase;\n\n// Legacy result type\nexport type PurchaseResult = {\n responseCode?: number;\n debugMessage?: string;\n code?: string;\n message?: string;\n purchaseTokenAndroid?: string;\n};\n/**\n * Centralized error codes for expo-iap\n * These are mapped to platform-specific error codes and provide consistent error handling\n */\nexport enum ErrorCode {\n E_UNKNOWN = 'E_UNKNOWN',\n E_USER_CANCELLED = 'E_USER_CANCELLED',\n E_USER_ERROR = 'E_USER_ERROR',\n E_ITEM_UNAVAILABLE = 'E_ITEM_UNAVAILABLE',\n E_REMOTE_ERROR = 'E_REMOTE_ERROR',\n E_NETWORK_ERROR = 'E_NETWORK_ERROR',\n E_SERVICE_ERROR = 'E_SERVICE_ERROR',\n E_RECEIPT_FAILED = 'E_RECEIPT_FAILED',\n E_RECEIPT_FINISHED_FAILED = 'E_RECEIPT_FINISHED_FAILED',\n E_NOT_PREPARED = 'E_NOT_PREPARED',\n E_NOT_ENDED = 'E_NOT_ENDED',\n E_ALREADY_OWNED = 'E_ALREADY_OWNED',\n E_DEVELOPER_ERROR = 'E_DEVELOPER_ERROR',\n E_BILLING_RESPONSE_JSON_PARSE_ERROR = 'E_BILLING_RESPONSE_JSON_PARSE_ERROR',\n E_DEFERRED_PAYMENT = 'E_DEFERRED_PAYMENT',\n E_INTERRUPTED = 'E_INTERRUPTED',\n E_IAP_NOT_AVAILABLE = 'E_IAP_NOT_AVAILABLE',\n E_PURCHASE_ERROR = 'E_PURCHASE_ERROR',\n E_SYNC_ERROR = 'E_SYNC_ERROR',\n E_TRANSACTION_VALIDATION_FAILED = 'E_TRANSACTION_VALIDATION_FAILED',\n E_ACTIVITY_UNAVAILABLE = 'E_ACTIVITY_UNAVAILABLE',\n E_ALREADY_PREPARED = 'E_ALREADY_PREPARED',\n E_PENDING = 'E_PENDING',\n E_CONNECTION_CLOSED = 'E_CONNECTION_CLOSED',\n}\n\n/**\n * Platform-specific error code mappings\n * Maps ErrorCode enum values to platform-specific integer codes\n */\nexport const ErrorCodeMapping = {\n ios: {\n [ErrorCode.E_UNKNOWN]: 0,\n [ErrorCode.E_SERVICE_ERROR]: 1,\n [ErrorCode.E_USER_CANCELLED]: 2,\n [ErrorCode.E_USER_ERROR]: 3,\n [ErrorCode.E_ITEM_UNAVAILABLE]: 4,\n [ErrorCode.E_REMOTE_ERROR]: 5,\n [ErrorCode.E_NETWORK_ERROR]: 6,\n [ErrorCode.E_RECEIPT_FAILED]: 7,\n [ErrorCode.E_RECEIPT_FINISHED_FAILED]: 8,\n [ErrorCode.E_DEVELOPER_ERROR]: 9,\n [ErrorCode.E_PURCHASE_ERROR]: 10,\n [ErrorCode.E_SYNC_ERROR]: 11,\n [ErrorCode.E_DEFERRED_PAYMENT]: 12,\n [ErrorCode.E_TRANSACTION_VALIDATION_FAILED]: 13,\n [ErrorCode.E_NOT_PREPARED]: 14,\n [ErrorCode.E_NOT_ENDED]: 15,\n [ErrorCode.E_ALREADY_OWNED]: 16,\n [ErrorCode.E_BILLING_RESPONSE_JSON_PARSE_ERROR]: 17,\n [ErrorCode.E_INTERRUPTED]: 18,\n [ErrorCode.E_IAP_NOT_AVAILABLE]: 19,\n [ErrorCode.E_ACTIVITY_UNAVAILABLE]: 20,\n [ErrorCode.E_ALREADY_PREPARED]: 21,\n [ErrorCode.E_PENDING]: 22,\n [ErrorCode.E_CONNECTION_CLOSED]: 23,\n },\n android: {\n [ErrorCode.E_UNKNOWN]: 'E_UNKNOWN',\n [ErrorCode.E_USER_CANCELLED]: 'E_USER_CANCELLED',\n [ErrorCode.E_USER_ERROR]: 'E_USER_ERROR',\n [ErrorCode.E_ITEM_UNAVAILABLE]: 'E_ITEM_UNAVAILABLE',\n [ErrorCode.E_REMOTE_ERROR]: 'E_REMOTE_ERROR',\n [ErrorCode.E_NETWORK_ERROR]: 'E_NETWORK_ERROR',\n [ErrorCode.E_SERVICE_ERROR]: 'E_SERVICE_ERROR',\n [ErrorCode.E_RECEIPT_FAILED]: 'E_RECEIPT_FAILED',\n [ErrorCode.E_RECEIPT_FINISHED_FAILED]: 'E_RECEIPT_FINISHED_FAILED',\n [ErrorCode.E_NOT_PREPARED]: 'E_NOT_PREPARED',\n [ErrorCode.E_NOT_ENDED]: 'E_NOT_ENDED',\n [ErrorCode.E_ALREADY_OWNED]: 'E_ALREADY_OWNED',\n [ErrorCode.E_DEVELOPER_ERROR]: 'E_DEVELOPER_ERROR',\n [ErrorCode.E_BILLING_RESPONSE_JSON_PARSE_ERROR]:\n 'E_BILLING_RESPONSE_JSON_PARSE_ERROR',\n [ErrorCode.E_DEFERRED_PAYMENT]: 'E_DEFERRED_PAYMENT',\n [ErrorCode.E_INTERRUPTED]: 'E_INTERRUPTED',\n [ErrorCode.E_IAP_NOT_AVAILABLE]: 'E_IAP_NOT_AVAILABLE',\n [ErrorCode.E_PURCHASE_ERROR]: 'E_PURCHASE_ERROR',\n [ErrorCode.E_SYNC_ERROR]: 'E_SYNC_ERROR',\n [ErrorCode.E_TRANSACTION_VALIDATION_FAILED]:\n 'E_TRANSACTION_VALIDATION_FAILED',\n [ErrorCode.E_ACTIVITY_UNAVAILABLE]: 'E_ACTIVITY_UNAVAILABLE',\n [ErrorCode.E_ALREADY_PREPARED]: 'E_ALREADY_PREPARED',\n [ErrorCode.E_PENDING]: 'E_PENDING',\n [ErrorCode.E_CONNECTION_CLOSED]: 'E_CONNECTION_CLOSED',\n },\n} as const;\n\nexport class PurchaseError implements Error {\n constructor(\n public name: string,\n public message: string,\n public responseCode?: number,\n public debugMessage?: string,\n public code?: ErrorCode,\n public productId?: string,\n public platform?: 'ios' | 'android',\n ) {\n this.name = '[expo-iap]: PurchaseError';\n this.message = message;\n this.responseCode = responseCode;\n this.debugMessage = debugMessage;\n this.code = code;\n this.productId = productId;\n this.platform = platform;\n }\n\n /**\n * Creates a PurchaseError from platform-specific error data\n * @param errorData Raw error data from native modules\n * @param platform Platform where the error occurred\n * @returns Properly typed PurchaseError instance\n */\n static fromPlatformError(\n errorData: any,\n platform: 'ios' | 'android',\n ): PurchaseError {\n const errorCode = errorData.code\n ? ErrorCodeUtils.fromPlatformCode(errorData.code, platform)\n : ErrorCode.E_UNKNOWN;\n\n return new PurchaseError(\n '[expo-iap]: PurchaseError',\n errorData.message || 'Unknown error occurred',\n errorData.responseCode,\n errorData.debugMessage,\n errorCode,\n errorData.productId,\n platform,\n );\n }\n\n /**\n * Gets the platform-specific error code for this error\n * @returns Platform-specific error code\n */\n getPlatformCode(): string | number | undefined {\n if (!this.code || !this.platform) return undefined;\n return ErrorCodeUtils.toPlatformCode(this.code, this.platform);\n }\n}\n\n/**\n * Utility functions for error code mapping and validation\n */\nexport const ErrorCodeUtils = {\n /**\n * Gets the native error code for the current platform\n * @param errorCode ErrorCode enum value\n * @returns Platform-specific error code from native constants\n */\n getNativeErrorCode: (errorCode: ErrorCode): string => {\n return NATIVE_ERROR_CODES[errorCode] || errorCode;\n },\n\n /**\n * Maps a platform-specific error code back to the standardized ErrorCode enum\n * @param platformCode Platform-specific error code (string for Android, number for iOS)\n * @param platform Target platform\n * @returns Corresponding ErrorCode enum value or E_UNKNOWN if not found\n */\n fromPlatformCode: (\n platformCode: string | number,\n platform: 'ios' | 'android',\n ): ErrorCode => {\n const mapping = ErrorCodeMapping[platform];\n\n for (const [errorCode, mappedCode] of Object.entries(mapping)) {\n if (mappedCode === platformCode) {\n return errorCode as ErrorCode;\n }\n }\n\n return ErrorCode.E_UNKNOWN;\n },\n\n /**\n * Maps an ErrorCode enum to platform-specific code\n * @param errorCode ErrorCode enum value\n * @param platform Target platform\n * @returns Platform-specific error code\n */\n toPlatformCode: (\n errorCode: ErrorCode,\n platform: 'ios' | 'android',\n ): string | number => {\n return (\n ErrorCodeMapping[platform][errorCode] ??\n (platform === 'ios' ? 0 : 'E_UNKNOWN')\n );\n },\n\n /**\n * Checks if an error code is valid for the specified platform\n * @param errorCode ErrorCode enum value\n * @param platform Target platform\n * @returns True if the error code is supported on the platform\n */\n isValidForPlatform: (\n errorCode: ErrorCode,\n platform: 'ios' | 'android',\n ): boolean => {\n return errorCode in ErrorCodeMapping[platform];\n },\n};\n\n// ============================================================================\n// Enhanced Unified Request Types\n// ============================================================================\n\n/**\n * Unified request props that work on both iOS and Android platforms\n * iOS will use 'sku', Android will use 'skus' (or convert sku to skus array)\n */\nexport interface UnifiedRequestPurchaseProps {\n // Universal properties - works on both platforms\n readonly sku?: string; // Single SKU (iOS native, Android fallback)\n readonly skus?: string[]; // Multiple SKUs (Android native, iOS uses first item)\n\n // iOS-specific properties (ignored on Android)\n readonly andDangerouslyFinishTransactionAutomaticallyIOS?: boolean;\n readonly appAccountToken?: string;\n readonly quantity?: number;\n readonly withOffer?: import('./types/ExpoIapIos.types').PaymentDiscount;\n\n // Android-specific properties (ignored on iOS)\n readonly obfuscatedAccountIdAndroid?: string;\n readonly obfuscatedProfileIdAndroid?: string;\n readonly isOfferPersonalized?: boolean;\n}\n\n/**\n * Unified subscription request props\n */\nexport interface UnifiedRequestSubscriptionProps\n extends UnifiedRequestPurchaseProps {\n // Android subscription-specific properties\n readonly purchaseTokenAndroid?: string;\n readonly replacementModeAndroid?: number;\n readonly subscriptionOffers?: {\n sku: string;\n offerToken: string;\n }[];\n}\n\n// ============================================================================\n// New Platform-Specific Request Types (v2.7.0+)\n// ============================================================================\n\n/**\n * iOS-specific purchase request parameters\n */\nexport interface IosRequestPurchaseProps {\n readonly sku: string;\n readonly andDangerouslyFinishTransactionAutomaticallyIOS?: boolean;\n readonly appAccountToken?: string;\n readonly quantity?: number;\n readonly withOffer?: import('./types/ExpoIapIos.types').PaymentDiscount;\n}\n\n/**\n * Android-specific purchase request parameters\n */\nexport interface AndroidRequestPurchaseProps {\n readonly skus: string[];\n readonly obfuscatedAccountIdAndroid?: string;\n readonly obfuscatedProfileIdAndroid?: string;\n readonly isOfferPersonalized?: boolean;\n}\n\n/**\n * Android-specific subscription request parameters\n */\nexport interface AndroidRequestSubscriptionProps extends AndroidRequestPurchaseProps {\n readonly purchaseTokenAndroid?: string;\n readonly replacementModeAndroid?: number;\n readonly subscriptionOffers: {\n sku: string;\n offerToken: string;\n }[];\n}\n\n/**\n * Modern platform-specific request structure (v2.7.0+)\n * Allows clear separation of iOS and Android parameters\n */\nexport interface PlatformRequestPurchaseProps {\n readonly ios?: IosRequestPurchaseProps;\n readonly android?: AndroidRequestPurchaseProps;\n}\n\n/**\n * Modern platform-specific subscription request structure (v2.7.0+)\n */\nexport interface PlatformRequestSubscriptionProps {\n readonly ios?: IosRequestPurchaseProps;\n readonly android?: AndroidRequestSubscriptionProps;\n}\n\n/**\n * Modern request purchase parameters (v2.7.0+)\n * This is the recommended API moving forward\n */\nexport type RequestPurchaseProps = PlatformRequestPurchaseProps;\n\n/**\n * Modern request subscription parameters (v2.7.0+)\n * This is the recommended API moving forward\n */\nexport type RequestSubscriptionProps = PlatformRequestSubscriptionProps;\n\n/**\n * Legacy request purchase parameters (deprecated)\n * Includes both unified and old platform-specific formats\n * @deprecated Use RequestPurchaseProps with platform-specific structure instead\n */\nexport type LegacyRequestPurchasePropsAll = UnifiedRequestPurchaseProps | LegacyRequestPurchaseProps;\n\n/**\n * Legacy request subscription parameters (deprecated)\n * Includes both unified and old platform-specific formats\n * @deprecated Use RequestSubscriptionProps with platform-specific structure instead\n */\nexport type LegacyRequestSubscriptionPropsAll = UnifiedRequestSubscriptionProps | LegacyRequestSubscriptionProps;\n\n/**\n * All supported request purchase parameters\n * Used internally for backward compatibility\n * @internal\n */\nexport type RequestPurchasePropsWithLegacy = RequestPurchaseProps | LegacyRequestPurchasePropsAll;\n\n/**\n * All supported request subscription parameters\n * Used internally for backward compatibility\n * @internal\n */\nexport type RequestSubscriptionPropsWithLegacy = RequestSubscriptionProps | LegacyRequestSubscriptionPropsAll;\n\n// ============================================================================\n// Type Guards and Utility Functions\n// ============================================================================\n\n// Type guards to check which API style is being used\nexport function isPlatformRequestProps(\n props: RequestPurchasePropsWithLegacy | RequestSubscriptionPropsWithLegacy\n): props is PlatformRequestPurchaseProps | PlatformRequestSubscriptionProps {\n return 'ios' in props || 'android' in props;\n}\n\nexport function isUnifiedRequestProps(\n props: RequestPurchasePropsWithLegacy | RequestSubscriptionPropsWithLegacy\n): props is UnifiedRequestPurchaseProps | UnifiedRequestSubscriptionProps {\n return 'sku' in props || 'skus' in props;\n}\n\nexport function isLegacyRequestProps(\n props: RequestPurchasePropsWithLegacy | RequestSubscriptionPropsWithLegacy\n): props is LegacyRequestPurchaseProps | LegacyRequestSubscriptionProps {\n return 'productId' in props || 'productIds' in props;\n}\n\n// Note: Other type guard functions are exported from index.ts to avoid conflicts\n"]}
package/build/index.d.ts CHANGED
@@ -8,7 +8,8 @@ export declare enum IapEvent {
8
8
  PurchaseUpdated = "purchase-updated",
9
9
  PurchaseError = "purchase-error",
10
10
  /** @deprecated Use PurchaseUpdated instead. This will be removed in a future version. */
11
- TransactionIapUpdated = "iap-transaction-updated"
11
+ TransactionIapUpdated = "iap-transaction-updated",
12
+ PromotedProductIOS = "promoted-product-ios"
12
13
  }
13
14
  export declare function setValueAsync(value: string): any;
14
15
  export declare const emitter: {
@@ -23,6 +24,29 @@ export declare const purchaseUpdatedListener: (listener: (event: Purchase) => vo
23
24
  export declare const purchaseErrorListener: (listener: (error: PurchaseError) => void) => {
24
25
  remove: () => void;
25
26
  };
27
+ /**
28
+ * iOS-only listener for App Store promoted product events.
29
+ * This fires when a user taps on a promoted product in the App Store.
30
+ *
31
+ * @param listener - Callback function that receives the promoted product details
32
+ * @returns EventSubscription that can be used to unsubscribe
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * const subscription = promotedProductListenerIOS((product) => {
37
+ * console.log('Promoted product:', product);
38
+ * // Handle the promoted product
39
+ * });
40
+ *
41
+ * // Later, clean up
42
+ * subscription.remove();
43
+ * ```
44
+ *
45
+ * @platform iOS
46
+ */
47
+ export declare const promotedProductListenerIOS: (listener: (product: Product) => void) => {
48
+ remove: () => void;
49
+ };
26
50
  export declare function initConnection(): any;
27
51
  export declare const getProducts: (skus: string[]) => Promise<Product[]>;
28
52
  export declare const getSubscriptions: (skus: string[]) => Promise<SubscriptionProduct[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,OAAO,EACP,eAAe,EACf,QAAQ,EACR,aAAa,EACb,cAAc,EACd,kCAAkC,EAClC,8BAA8B,EAC9B,mBAAmB,EACnB,oBAAoB,EAGrB,MAAM,iBAAiB,CAAC;AAKzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAGhE,eAAO,MAAM,EAAE,KAAmB,CAAC;AAEnC,oBAAY,QAAQ;IAClB,eAAe,qBAAqB;IACpC,aAAa,mBAAmB;IAChC,yFAAyF;IACzF,qBAAqB,4BAA4B;CA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AAO,EAAE,kCAAkC,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAmDN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,eAAe,GAC1B,YAAY,eAAe,KAC1B,OAAO,CACN,eAAe,GACf,oBAAoB,GACpB,eAAe,EAAE,GACjB,oBAAoB,EAAE,GACtB,IAAI,CAmGP,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,kCAAkC,KAC1C,OAAO,CAAC,oBAAoB,GAAG,oBAAoB,EAAE,GAAG,IAAI,GAAG,IAAI,CASrE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,6BAG/B;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,KAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAiCnC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,QAAO,OAAO,CAAC,MAAM,CAMjD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,OAAO,CAAC,MAAM,CAK9C,CAAC;AAEF,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC"}
package/build/index.js CHANGED
@@ -19,6 +19,7 @@ export var IapEvent;
19
19
  IapEvent["PurchaseError"] = "purchase-error";
20
20
  /** @deprecated Use PurchaseUpdated instead. This will be removed in a future version. */
21
21
  IapEvent["TransactionIapUpdated"] = "iap-transaction-updated";
22
+ IapEvent["PromotedProductIOS"] = "promoted-product-ios";
22
23
  })(IapEvent || (IapEvent = {}));
23
24
  export function setValueAsync(value) {
24
25
  return ExpoIapModule.setValueAsync(value);
@@ -32,11 +33,38 @@ export const purchaseUpdatedListener = (listener) => {
32
33
  export const purchaseErrorListener = (listener) => {
33
34
  return emitter.addListener(IapEvent.PurchaseError, listener);
34
35
  };
36
+ /**
37
+ * iOS-only listener for App Store promoted product events.
38
+ * This fires when a user taps on a promoted product in the App Store.
39
+ *
40
+ * @param listener - Callback function that receives the promoted product details
41
+ * @returns EventSubscription that can be used to unsubscribe
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * const subscription = promotedProductListenerIOS((product) => {
46
+ * console.log('Promoted product:', product);
47
+ * // Handle the promoted product
48
+ * });
49
+ *
50
+ * // Later, clean up
51
+ * subscription.remove();
52
+ * ```
53
+ *
54
+ * @platform iOS
55
+ */
56
+ export const promotedProductListenerIOS = (listener) => {
57
+ if (Platform.OS !== 'ios') {
58
+ console.warn('promotedProductListenerIOS: This listener is only available on iOS');
59
+ return { remove: () => { } };
60
+ }
61
+ return emitter.addListener(IapEvent.PromotedProductIOS, listener);
62
+ };
35
63
  export function initConnection() {
36
64
  return ExpoIapModule.initConnection();
37
65
  }
38
66
  export const getProducts = async (skus) => {
39
- console.warn("`getProducts` is deprecated. Use `requestProducts({ skus, type: 'inapp' })` instead. This function will be removed in version 3.0.0.");
67
+ console.warn('`getProducts` is deprecated. Use `requestProducts({ skus, type: \'inapp\' })` instead. This function will be removed in version 3.0.0.');
40
68
  if (!skus?.length) {
41
69
  return Promise.reject(new Error('"skus" is required'));
42
70
  }
@@ -61,7 +89,7 @@ export const getProducts = async (skus) => {
61
89
  })();
62
90
  };
63
91
  export const getSubscriptions = async (skus) => {
64
- console.warn("`getSubscriptions` is deprecated. Use `requestProducts({ skus, type: 'subs' })` instead. This function will be removed in version 3.0.0.");
92
+ console.warn('`getSubscriptions` is deprecated. Use `requestProducts({ skus, type: \'subs\' })` instead. This function will be removed in version 3.0.0.');
65
93
  if (!skus?.length) {
66
94
  return Promise.reject(new Error('"skus" is required'));
67
95
  }
@@ -158,7 +186,7 @@ export const requestProducts = async ({ skus, type = 'inapp', }) => {
158
186
  * @deprecated Use `getPurchaseHistories` instead. This function will be removed in version 3.0.0.
159
187
  */
160
188
  export const getPurchaseHistory = ({ alsoPublishToEventListener = false, onlyIncludeActiveItems = false, } = {}) => {
161
- console.warn('`getPurchaseHistory` is deprecated. Use `getPurchaseHistories` instead. This function will be removed in version 3.0.0.');
189
+ console.warn("`getPurchaseHistory` is deprecated. Use `getPurchaseHistories` instead. This function will be removed in version 3.0.0.");
162
190
  return getPurchaseHistories({
163
191
  alsoPublishToEventListener,
164
192
  onlyIncludeActiveItems,