expo-iap 2.7.5 → 2.7.7-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.
- package/.copilot-instructions.md +8 -26
- package/.markdownlint.json +11 -0
- package/CHANGELOG.md +56 -34
- package/CONTRIBUTING.md +2 -25
- package/build/ExpoIap.types.d.ts.map +1 -1
- package/build/ExpoIap.types.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5 -4
- package/build/index.js.map +1 -1
- package/build/modules/android.d.ts.map +1 -1
- package/build/modules/android.js.map +1 -1
- package/build/modules/ios.d.ts.map +1 -1
- package/build/modules/ios.js.map +1 -1
- package/build/useIap.d.ts.map +1 -1
- package/build/useIap.js +1 -1
- package/build/useIap.js.map +1 -1
- package/ios/ExpoIapModule.swift +92 -52
- package/ios/expoiap.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/expoiap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/package.json +1 -1
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/src/ExpoIap.types.ts +8 -17
- package/src/index.ts +37 -33
- package/src/modules/android.ts +4 -2
- package/src/modules/ios.ts +47 -87
- package/src/useIap.ts +5 -8
package/.copilot-instructions.md
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
229
|
-
},
|
|
230
|
-
|
|
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,83 +1,105 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.7.7] - TBD
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- iOS: Fixed hot reload issues with concurrent StoreKit operations
|
|
8
|
+
- iOS: Resolved race conditions in `Promise.all` usage
|
|
9
|
+
- iOS: Improved state cleanup on `initConnection()`
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- iOS: Added `ensureConnection()` pattern matching Android
|
|
14
|
+
- iOS: Simplified module architecture
|
|
15
|
+
|
|
16
|
+
## [2.7.6] - 2025-08-01
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Fixed `initConnection()` return type
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
|
|
24
|
+
- Added available-purchases example
|
|
25
|
+
- Improved build error FAQs
|
|
26
|
+
- Enhanced setup documentation
|
|
27
|
+
|
|
3
28
|
## [2.7.5] - 2025-07-24
|
|
4
29
|
|
|
5
30
|
### Added
|
|
6
31
|
|
|
7
|
-
- iOS promoted product support
|
|
8
|
-
- `promotedProductListenerIOS()`
|
|
9
|
-
-
|
|
10
|
-
- `buyPromotedProductIOS()` method to complete promoted product purchases
|
|
11
|
-
- `promotedProductIOS` state in useIAP hook for promoted product data
|
|
12
|
-
- `onPromotedProductIOS` callback option in useIAP hook
|
|
32
|
+
- iOS promoted product support
|
|
33
|
+
- `promotedProductListenerIOS()`, `getPromotedProductIOS()`, `buyPromotedProductIOS()` methods
|
|
34
|
+
- Promoted product support in useIAP hook
|
|
13
35
|
|
|
14
36
|
### Changed
|
|
15
37
|
|
|
16
|
-
- Promoted product listener now
|
|
17
|
-
- Updated
|
|
18
|
-
- Removed Manual Connection Management section from lifecycle documentation
|
|
38
|
+
- Promoted product listener now returns full Product object
|
|
39
|
+
- Updated documentation and examples
|
|
19
40
|
|
|
20
41
|
### Fixed
|
|
21
42
|
|
|
22
|
-
- iOS build error in promoted product
|
|
23
|
-
- Type safety improvements
|
|
43
|
+
- iOS build error in promoted product handler
|
|
44
|
+
- Type safety improvements
|
|
24
45
|
|
|
25
46
|
## [2.7.4] - 2025-07-24
|
|
26
47
|
|
|
27
48
|
### Fixed
|
|
28
49
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
- Ensure compatibility with devices running iOS versions below 18.4
|
|
50
|
+
- iOS 18.4+ availability check for `appTransactionID`
|
|
51
|
+
- TypeScript compatibility for older iOS versions
|
|
32
52
|
|
|
33
53
|
## [2.7.3] - 2025-07-23
|
|
34
54
|
|
|
35
55
|
### Fixed
|
|
36
56
|
|
|
37
|
-
-
|
|
38
|
-
-
|
|
57
|
+
- Android Google Play Billing Library v8.0.0 upgrade
|
|
58
|
+
- Kotlin version compatibility
|
|
39
59
|
|
|
40
60
|
### Changed
|
|
41
61
|
|
|
42
|
-
- Android
|
|
43
|
-
- Added
|
|
62
|
+
- Android requires Kotlin 2.0+
|
|
63
|
+
- Added expo-build-properties requirement
|
|
44
64
|
|
|
45
65
|
### Documentation
|
|
46
66
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
67
|
+
- Android configuration guide
|
|
68
|
+
- Kotlin version requirements
|
|
49
69
|
|
|
50
70
|
## [2.7.2] - 2025-07-22
|
|
51
71
|
|
|
52
72
|
### Added
|
|
53
73
|
|
|
54
|
-
- iOS 16.0+ app transaction support
|
|
74
|
+
- iOS 16.0+ app transaction support
|
|
55
75
|
|
|
56
76
|
## [2.7.1] - 2025-07-22
|
|
57
77
|
|
|
58
78
|
### Fixed
|
|
59
79
|
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
80
|
+
- Added missing `requestProducts()` API
|
|
81
|
+
- Fixed `getStorefrontIOS()` platform handling
|
|
82
|
+
- Documentation build fixes
|
|
83
|
+
|
|
84
|
+
### Changed
|
|
85
|
+
|
|
86
|
+
- Added deprecation warnings to `getProducts()` and `getSubscriptions()`
|
|
65
87
|
|
|
66
88
|
## [2.7.0] - 2025-07-22
|
|
67
89
|
|
|
68
90
|
### Added
|
|
69
91
|
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
- Detailed
|
|
92
|
+
- Platform-specific API for `requestPurchase`
|
|
93
|
+
- Google Play Billing Library v8.0.0 support
|
|
94
|
+
- Android automatic reconnection
|
|
95
|
+
- Detailed error codes
|
|
74
96
|
|
|
75
97
|
### Changed
|
|
76
98
|
|
|
77
|
-
- Deprecated `requestSubscription`
|
|
78
|
-
-
|
|
99
|
+
- Deprecated `requestSubscription`
|
|
100
|
+
- Removed Android `getPurchaseHistory()`
|
|
79
101
|
|
|
80
102
|
### Breaking Changes
|
|
81
103
|
|
|
82
|
-
- Android: `getPurchaseHistory()` removed
|
|
83
|
-
- Android: Requires Google Play Billing
|
|
104
|
+
- Android: `getPurchaseHistory()` removed
|
|
105
|
+
- Android: Requires Google Play Billing 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":"","sources":["../src/ExpoIap.types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,EAC3B,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAGlC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAGF,MAAM,MAAM,WAAW,GAAG;IAAC,QAAQ,EAAE,KAAK,C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C,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;AAgJF,+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\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,SAy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O,SAAsB,CAAC;YAChC,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC,SAAS,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACH,cAAc,EAAE,CACd,SAAoB,EACpB,QAA2B,EACV,EAAE;QACnB,OAAO,CACL,gBAAgB,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC;YACrC,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,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
|
@@ -47,7 +47,7 @@ export declare const purchaseErrorListener: (listener: (error: PurchaseError) =>
|
|
|
47
47
|
export declare const promotedProductListenerIOS: (listener: (product: Product) => void) => {
|
|
48
48
|
remove: () => void;
|
|
49
49
|
};
|
|
50
|
-
export declare function initConnection():
|
|
50
|
+
export declare function initConnection(): Promise<boolean>;
|
|
51
51
|
export declare const getProducts: (skus: string[]) => Promise<Product[]>;
|
|
52
52
|
export declare const getSubscriptions: (skus: string[]) => Promise<SubscriptionProduct[]>;
|
|
53
53
|
export declare function endConnection(): Promise<boolean>;
|
package/build/index.d.ts.map
CHANGED
|
@@ -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;
|
|
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;AASzB,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;IACjD,kBAAkB,yB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,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
|
@@ -61,10 +61,11 @@ export const promotedProductListenerIOS = (listener) => {
|
|
|
61
61
|
return emitter.addListener(IapEvent.PromotedProductIOS, listener);
|
|
62
62
|
};
|
|
63
63
|
export function initConnection() {
|
|
64
|
-
|
|
64
|
+
const result = ExpoIapModule.initConnection();
|
|
65
|
+
return Promise.resolve(result);
|
|
65
66
|
}
|
|
66
67
|
export const getProducts = async (skus) => {
|
|
67
|
-
console.warn(
|
|
68
|
+
console.warn('`getProducts` is deprecated. Use `requestProducts({ skus, type: \'inapp\' })` instead. This function will be removed in version 3.0.0.');
|
|
68
69
|
if (!skus?.length) {
|
|
69
70
|
return Promise.reject(new Error('"skus" is required'));
|
|
70
71
|
}
|
|
@@ -89,7 +90,7 @@ export const getProducts = async (skus) => {
|
|
|
89
90
|
})();
|
|
90
91
|
};
|
|
91
92
|
export const getSubscriptions = async (skus) => {
|
|
92
|
-
console.warn(
|
|
93
|
+
console.warn('`getSubscriptions` is deprecated. Use `requestProducts({ skus, type: \'subs\' })` instead. This function will be removed in version 3.0.0.');
|
|
93
94
|
if (!skus?.length) {
|
|
94
95
|
return Promise.reject(new Error('"skus" is required'));
|
|
95
96
|
}
|
|
@@ -186,7 +187,7 @@ export const requestProducts = async ({ skus, type = 'inapp', }) => {
|
|
|
186
187
|
* @deprecated Use `getPurchaseHistories` instead. This function will be removed in version 3.0.0.
|
|
187
188
|
*/
|
|
188
189
|
export const getPurchaseHistory = ({ alsoPublishToEventListener = false, onlyIncludeActiveItems = false, } = {}) => {
|
|
189
|
-
console.warn(
|
|
190
|
+
console.warn("`getPurchaseHistory` is deprecated. Use `getPurchaseHistories` instead. This function will be removed in version 3.0.0.");
|
|
190
191
|
return getPurchaseHistories({
|
|
191
192
|
alsoPublishToEventListener,
|
|
192
193
|
onlyIncludeActiveItems,
|