expo-iap 2.7.7-rc.1 → 2.7.8
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 +26 -8
- package/.markdownlint.json +2 -5
- package/CHANGELOG.md +28 -1
- package/CONTRIBUTING.md +25 -2
- package/README.md +6 -6
- package/build/ExpoIap.types.d.ts.map +1 -1
- package/build/ExpoIap.types.js.map +1 -1
- package/build/index.d.ts +14 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +37 -6
- 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 +8 -2
- package/build/useIap.d.ts.map +1 -1
- package/build/useIap.js +4 -25
- package/build/useIap.js.map +1 -1
- package/package.json +1 -1
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/src/ExpoIap.types.ts +17 -8
- package/src/index.ts +76 -37
- package/src/modules/android.ts +2 -4
- package/src/modules/ios.ts +87 -47
- package/src/useIap.ts +18 -32
- package/ios/expoiap.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/expoiap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
package/.copilot-instructions.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# GitHub Copilot Instructions for expo-iap
|
|
2
2
|
|
|
3
3
|
## Package Manager
|
|
4
|
+
|
|
4
5
|
**IMPORTANT: This project uses Bun exclusively. Do not suggest npm, yarn, or pnpm commands.**
|
|
5
6
|
|
|
6
7
|
- Install dependencies: `bun install`
|
|
@@ -16,7 +17,9 @@
|
|
|
16
17
|
When suggesting code for expo-iap, follow these naming conventions:
|
|
17
18
|
|
|
18
19
|
### Platform-Specific Functions
|
|
20
|
+
|
|
19
21
|
Functions that only work on one platform MUST have platform suffixes:
|
|
22
|
+
|
|
20
23
|
- iOS: `functionNameIos()`
|
|
21
24
|
- Android: `functionNameAndroid()`
|
|
22
25
|
|
|
@@ -28,16 +31,21 @@ export const getAppTransactionIos = async (): Promise<AppTransactionIOS | null>
|
|
|
28
31
|
```
|
|
29
32
|
|
|
30
33
|
### Cross-Platform Functions
|
|
34
|
+
|
|
31
35
|
Functions that abstract platform differences don't need suffixes:
|
|
32
36
|
|
|
33
37
|
```typescript
|
|
34
38
|
// Correct cross-platform example:
|
|
35
39
|
export const getProducts = async (skus: string[]): Promise<Product[]> => {
|
|
36
40
|
return Platform.select({
|
|
37
|
-
ios: async () => {
|
|
38
|
-
|
|
41
|
+
ios: async () => {
|
|
42
|
+
/* iOS implementation */
|
|
43
|
+
},
|
|
44
|
+
android: async () => {
|
|
45
|
+
/* Android implementation */
|
|
46
|
+
},
|
|
39
47
|
})();
|
|
40
|
-
}
|
|
48
|
+
};
|
|
41
49
|
```
|
|
42
50
|
|
|
43
51
|
## Project Overview
|
|
@@ -193,6 +201,7 @@ const handleSubscription = async (subscriptionId: string) => {
|
|
|
193
201
|
## Code Suggestions
|
|
194
202
|
|
|
195
203
|
When generating code:
|
|
204
|
+
|
|
196
205
|
1. Check if the function is platform-specific
|
|
197
206
|
2. Add appropriate suffix if it only works on one platform
|
|
198
207
|
3. Use Platform.select() for cross-platform implementations
|
|
@@ -201,7 +210,9 @@ When generating code:
|
|
|
201
210
|
6. Add JSDoc comments for public APIs
|
|
202
211
|
|
|
203
212
|
## Testing
|
|
213
|
+
|
|
204
214
|
Suggest tests that:
|
|
215
|
+
|
|
205
216
|
- Cover both iOS and Android paths
|
|
206
217
|
- Use `bun test` commands
|
|
207
218
|
- Include platform mocking when needed
|
|
@@ -210,12 +221,19 @@ Suggest tests that:
|
|
|
210
221
|
## Common Patterns
|
|
211
222
|
|
|
212
223
|
### Platform Selection
|
|
224
|
+
|
|
213
225
|
```typescript
|
|
214
226
|
Platform.select({
|
|
215
|
-
ios: () => {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
227
|
+
ios: () => {
|
|
228
|
+
/* iOS code */
|
|
229
|
+
},
|
|
230
|
+
android: () => {
|
|
231
|
+
/* Android code */
|
|
232
|
+
},
|
|
233
|
+
default: () => {
|
|
234
|
+
/* Fallback */
|
|
235
|
+
},
|
|
236
|
+
});
|
|
219
237
|
```
|
|
220
238
|
|
|
221
239
|
### Receipt Validation (Platform-specific parameters)
|
|
@@ -300,4 +318,4 @@ const result = await requestPurchase({
|
|
|
300
318
|
});
|
|
301
319
|
```
|
|
302
320
|
|
|
303
|
-
While maintaining full power and flexibility for advanced enterprise use cases.
|
|
321
|
+
While maintaining full power and flexibility for advanced enterprise use cases.
|
package/.markdownlint.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [2.7.
|
|
3
|
+
## [2.7.8]
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Exported `validateReceipt` function from main API with security warnings
|
|
8
|
+
- Documentation about iOS unfinished transactions behavior
|
|
9
|
+
- Documentation about Android 3-day acknowledgment requirement
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Documentation incorrectly stating Android auto-validates receipts
|
|
14
|
+
- Added explicit `isConsumable: false` default value in `finishTransaction`
|
|
15
|
+
- Markdownlint warnings (MD032, MD033, MD024)
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Moved `validateReceipt` from hook-only to main exports
|
|
20
|
+
- Enhanced security warnings for client-side receipt validation
|
|
21
|
+
- Updated troubleshooting guide with `onPurchaseSuccess` auto-trigger issue
|
|
22
|
+
|
|
23
|
+
### Documentation
|
|
24
|
+
|
|
25
|
+
- Added comprehensive guide for handling unfinished transactions
|
|
26
|
+
- Clarified platform-specific transaction acknowledgment behavior
|
|
27
|
+
- Emphasized server-side validation requirement for both iOS and Android
|
|
28
|
+
|
|
29
|
+
## [2.7.7]
|
|
4
30
|
|
|
5
31
|
### Fixed
|
|
6
32
|
|
|
7
33
|
- iOS: Fixed hot reload issues with concurrent StoreKit operations
|
|
8
34
|
- iOS: Resolved race conditions in `Promise.all` usage
|
|
9
35
|
- iOS: Improved state cleanup on `initConnection()`
|
|
36
|
+
- Fixed `useIAP` hook's internal methods to use `requestProducts` instead of deprecated `getSubscriptions`
|
|
10
37
|
|
|
11
38
|
### Changed
|
|
12
39
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -25,12 +25,14 @@ 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
|
+
|
|
28
29
|
```bash
|
|
29
30
|
git clone https://github.com/hyochan/expo-iap.git
|
|
30
31
|
cd expo-iap
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
2. Install dependencies using Bun:
|
|
35
|
+
|
|
34
36
|
```bash
|
|
35
37
|
bun install
|
|
36
38
|
```
|
|
@@ -42,6 +44,7 @@ This project includes VSCode configurations for easier development:
|
|
|
42
44
|
1. **Install recommended extensions**: When you open the project in VSCode, you'll be prompted to install recommended extensions. Accept to install them.
|
|
43
45
|
|
|
44
46
|
2. **Use Debug Configurations**: Press `F5` or go to Run → Start Debugging and select:
|
|
47
|
+
|
|
45
48
|
- `Debug iOS (Expo)` - Runs the example app on iOS simulator
|
|
46
49
|
- `Debug Android (Expo)` - Runs the example app on Android emulator
|
|
47
50
|
- `iOS + Metro` - Starts Metro bundler and iOS app together
|
|
@@ -75,16 +78,19 @@ The example app is a great way to test your changes and see the library in actio
|
|
|
75
78
|
### Setup
|
|
76
79
|
|
|
77
80
|
1. Navigate to the example directory:
|
|
81
|
+
|
|
78
82
|
```bash
|
|
79
83
|
cd example
|
|
80
84
|
```
|
|
81
85
|
|
|
82
86
|
2. Install example app dependencies:
|
|
87
|
+
|
|
83
88
|
```bash
|
|
84
89
|
bun install
|
|
85
90
|
```
|
|
86
91
|
|
|
87
92
|
3. For iOS development, install pods:
|
|
93
|
+
|
|
88
94
|
```bash
|
|
89
95
|
cd ios
|
|
90
96
|
pod install
|
|
@@ -94,26 +100,31 @@ cd ..
|
|
|
94
100
|
### Running the App
|
|
95
101
|
|
|
96
102
|
#### iOS
|
|
103
|
+
|
|
97
104
|
```bash
|
|
98
105
|
bun run ios
|
|
99
106
|
```
|
|
100
107
|
|
|
101
108
|
Or open the project in Xcode:
|
|
109
|
+
|
|
102
110
|
```bash
|
|
103
111
|
open ios/cpk.xcworkspace
|
|
104
112
|
```
|
|
105
113
|
|
|
106
114
|
**Note**: If you encounter build errors, you may need to:
|
|
115
|
+
|
|
107
116
|
1. Clean the build: `cd ios && xcodebuild clean`
|
|
108
117
|
2. Update pods: `cd ios && pod install`
|
|
109
118
|
3. Open in Xcode and build from there for better error messages
|
|
110
119
|
|
|
111
120
|
#### Android
|
|
121
|
+
|
|
112
122
|
```bash
|
|
113
123
|
bun run android
|
|
114
124
|
```
|
|
115
125
|
|
|
116
126
|
Or open the project in Android Studio:
|
|
127
|
+
|
|
117
128
|
```bash
|
|
118
129
|
open -a "Android Studio" android
|
|
119
130
|
```
|
|
@@ -123,6 +134,7 @@ open -a "Android Studio" android
|
|
|
123
134
|
### Development Server
|
|
124
135
|
|
|
125
136
|
Start the Metro bundler:
|
|
137
|
+
|
|
126
138
|
```bash
|
|
127
139
|
bun start
|
|
128
140
|
```
|
|
@@ -138,7 +150,7 @@ bun start
|
|
|
138
150
|
# Run on iOS simulator
|
|
139
151
|
bun run ios
|
|
140
152
|
|
|
141
|
-
# Run on Android emulator
|
|
153
|
+
# Run on Android emulator
|
|
142
154
|
bun run android
|
|
143
155
|
|
|
144
156
|
# Run tests
|
|
@@ -214,6 +226,7 @@ bun test
|
|
|
214
226
|
```
|
|
215
227
|
|
|
216
228
|
Run tests with coverage:
|
|
229
|
+
|
|
217
230
|
```bash
|
|
218
231
|
bun run test:coverage
|
|
219
232
|
```
|
|
@@ -226,6 +239,7 @@ bun run test:coverage
|
|
|
226
239
|
- Test both iOS and Android code paths
|
|
227
240
|
|
|
228
241
|
Example test structure:
|
|
242
|
+
|
|
229
243
|
```typescript
|
|
230
244
|
import { render, fireEvent } from '@testing-library/react-native';
|
|
231
245
|
import MyComponent from '../MyComponent';
|
|
@@ -239,6 +253,7 @@ describe('MyComponent', () => {
|
|
|
239
253
|
```
|
|
240
254
|
|
|
241
255
|
**Known Issues**:
|
|
256
|
+
|
|
242
257
|
- React Native modules may need to be mocked in tests
|
|
243
258
|
- Use Jest's module mocking for native dependencies
|
|
244
259
|
- Some tests may fail due to native module dependencies
|
|
@@ -248,11 +263,13 @@ describe('MyComponent', () => {
|
|
|
248
263
|
### Linting
|
|
249
264
|
|
|
250
265
|
Run linting checks:
|
|
266
|
+
|
|
251
267
|
```bash
|
|
252
268
|
bun run lint
|
|
253
269
|
```
|
|
254
270
|
|
|
255
271
|
Fix linting issues:
|
|
272
|
+
|
|
256
273
|
```bash
|
|
257
274
|
bun run lint:eslint
|
|
258
275
|
bun run lint:prettier
|
|
@@ -268,6 +285,7 @@ bun run lint:prettier
|
|
|
268
285
|
### Code Formatting
|
|
269
286
|
|
|
270
287
|
We use Prettier for code formatting. Format your code:
|
|
288
|
+
|
|
271
289
|
```bash
|
|
272
290
|
bun run lint:prettier
|
|
273
291
|
```
|
|
@@ -277,6 +295,7 @@ bun run lint:prettier
|
|
|
277
295
|
### Commit Messages
|
|
278
296
|
|
|
279
297
|
Follow conventional commit format:
|
|
298
|
+
|
|
280
299
|
```
|
|
281
300
|
type(scope): subject
|
|
282
301
|
|
|
@@ -286,6 +305,7 @@ footer
|
|
|
286
305
|
```
|
|
287
306
|
|
|
288
307
|
Types:
|
|
308
|
+
|
|
289
309
|
- `feat`: New feature
|
|
290
310
|
- `fix`: Bug fix
|
|
291
311
|
- `docs`: Documentation changes
|
|
@@ -295,6 +315,7 @@ Types:
|
|
|
295
315
|
- `chore`: Maintenance tasks
|
|
296
316
|
|
|
297
317
|
Example:
|
|
318
|
+
|
|
298
319
|
```
|
|
299
320
|
feat(ios): add getStorefrontIos function
|
|
300
321
|
|
|
@@ -329,6 +350,7 @@ Closes #123
|
|
|
329
350
|
## 🐛 Reporting Issues
|
|
330
351
|
|
|
331
352
|
When reporting issues, please include:
|
|
353
|
+
|
|
332
354
|
- expo-iap version
|
|
333
355
|
- React Native/Expo SDK version
|
|
334
356
|
- Platform (iOS/Android)
|
|
@@ -340,6 +362,7 @@ When reporting issues, please include:
|
|
|
340
362
|
## 💡 Feature Requests
|
|
341
363
|
|
|
342
364
|
We welcome feature requests! Please:
|
|
365
|
+
|
|
343
366
|
- Check existing issues first
|
|
344
367
|
- Provide use case and motivation
|
|
345
368
|
- Consider implementation approach
|
|
@@ -352,4 +375,4 @@ We welcome feature requests! Please:
|
|
|
352
375
|
- [Example App](./example)
|
|
353
376
|
- [Platform-Specific Guidelines](./docs/PLATFORM_NAMING.md)
|
|
354
377
|
|
|
355
|
-
Thank you for contributing to expo-iap! 🎉
|
|
378
|
+
Thank you for contributing to expo-iap! 🎉
|
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Expo IAP
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
<
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="https://expo-iap.hyo.dev/img/icon.png" alt="Expo IAP Logo" width="150" />
|
|
5
|
+
<h1>Expo IAP</h1>
|
|
6
|
+
<p>In app purchase module in <a href="https://docs.expo.dev/guides/in-app-purchases">Expo</a></p>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
9
|
[](https://npmjs.org/package/expo-iap) [](https://npmjs.org/package/expo-iap) [](https://app.fossa.com/projects/git%2Bgithub.com%2Fhyochan%2Fexpo-iap?ref=badge_shield&issueType=license)
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
- [🎣 useIAP Hook API](https://expo-iap.hyo.dev/docs/api/use-iap)
|
|
20
20
|
- [⚠️ Error Codes](https://expo-iap.hyo.dev/docs/api/error-codes)
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
## Notice
|
|
23
23
|
|
|
24
24
|
The `expo-iap` module has been migrated from [react-native-iap](https://github.com/dooboolab/react-native-iap). Moving forward, the `react-native-iap` repository will gradually be deprecated, and `expo-iap` will become the actively maintained module. Please take note of this transition. For more details, refer to the [Future Roadmap and Discussion in react-native-iap](https://github.com/dooboolab-community/react-native-iap/discussions/2754). Additionally, you can check the [Current Project Status comment](https://github.com/dooboolab-community/react-native-iap/discussions/2754#discussioncomment-10510249) to stay updated on the project's progress.
|
|
25
25
|
|
|
@@ -74,4 +74,4 @@ For detailed usage examples and error handling, see the [documentation](https://
|
|
|
74
74
|
|
|
75
75
|
## Past Sponsors
|
|
76
76
|
|
|
77
|
-
<a href="https://namiml.com"><img src="https://github.com/hyochan/react-native-iap/assets/27461460/89d71f61-bb73-400a-83bd-fe0f96eb726e" width="280"/></a>
|
|
77
|
+
<a href="https://namiml.com"><img src="https://github.com/hyochan/react-native-iap/assets/27461460/89d71f61-bb73-400a-83bd-fe0f96eb726e" alt="Nami ML" width="280"/></a>
|
|
@@ -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,C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C,QAAQ,CAAC,CAAC;QAE3C,KAAK,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9D,IAAI,UAAU,KAAK,YAAY,EAAE,CAAC;gBAChC,OAAO,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"]}
|
|
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,oDAAuC,CAAA;IACvC,wFAA2E,CAAA;IAC3E,sDAAyC,CAAA;IACzC,4CAA+B,CAAA;IAC/B,wDAA2C,CAAA;IAC3C,kDAAqC,CAAA;IACrC,0CAA6B,CAAA;IAC7B,gFAAmE,CAAA;IACnE,8DAAiD,CAAA;IACjD,sDAAyC,CAAA;IACzC,oCAAuB,CAAA;IACvB,wDAA2C,CAAA;AAC7C,CAAC,EAzBW,SAAS,KAAT,SAAS,QAyBpB;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,GAAG,EAAE;QACH,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;QACxB,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,CAAC;QAC9B,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC/B,CA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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"]}
|
package/build/index.d.ts
CHANGED
|
@@ -180,6 +180,20 @@ export declare const getStorefrontIOS: () => Promise<string>;
|
|
|
180
180
|
* @deprecated Use `getStorefrontIOS` instead. This function will be removed in version 3.0.0.
|
|
181
181
|
*/
|
|
182
182
|
export declare const getStorefront: () => Promise<string>;
|
|
183
|
+
/**
|
|
184
|
+
* Internal receipt validation function (NOT RECOMMENDED for production use)
|
|
185
|
+
*
|
|
186
|
+
* WARNING: This function performs client-side validation which is NOT secure.
|
|
187
|
+
* For production apps, always validate receipts on your secure server:
|
|
188
|
+
* - iOS: Send receipt data to Apple's verification endpoint from your server
|
|
189
|
+
* - Android: Use Google Play Developer API with service account credentials
|
|
190
|
+
*/
|
|
191
|
+
export declare const validateReceipt: (sku: string, androidOptions?: {
|
|
192
|
+
packageName: string;
|
|
193
|
+
productToken: string;
|
|
194
|
+
accessToken: string;
|
|
195
|
+
isSub?: boolean;
|
|
196
|
+
}) => Promise<any>;
|
|
183
197
|
export * from './useIap';
|
|
184
198
|
export * from './utils/errorMapping';
|
|
185
199
|
//# sourceMappingURL=index.d.ts.map
|
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;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;IACjD,kBAAkB,yBAAyB;CAC5C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,OAE1C;AAGD,eAAO,MAAM,OAAO,EAAoD;IACtE,WAAW,EAAE,CACX,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,KAC/B;QAAC,MAAM,EAAE,MAAM,IAAI,CAAA;KAAC,CAAC;IAC1B,cAAc,EAAE,CACd,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,KAC/B,IAAI,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,UAAU,CAAC,KAAK,EAAE,QAA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c,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import { NativeModulesProxy } from 'expo-modules-core';
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
// Internal modules
|
|
5
5
|
import ExpoIapModule from './ExpoIapModule';
|
|
6
|
-
import { isProductIos } from './modules/ios';
|
|
7
|
-
import { isProductAndroid } from './modules/android';
|
|
6
|
+
import { isProductIos, validateReceiptIOS } from './modules/ios';
|
|
7
|
+
import { isProductAndroid, validateReceiptAndroid } from './modules/android';
|
|
8
8
|
// Types
|
|
9
9
|
import { isPlatformRequestProps, isUnifiedRequestProps, } from './ExpoIap.types';
|
|
10
10
|
// Export all types
|
|
@@ -65,7 +65,7 @@ export function initConnection() {
|
|
|
65
65
|
return Promise.resolve(result);
|
|
66
66
|
}
|
|
67
67
|
export const getProducts = async (skus) => {
|
|
68
|
-
console.warn(
|
|
68
|
+
console.warn("`getProducts` is deprecated. Use `requestProducts({ skus, type: 'inapp' })` instead. This function will be removed in version 3.0.0.");
|
|
69
69
|
if (!skus?.length) {
|
|
70
70
|
return Promise.reject(new Error('"skus" is required'));
|
|
71
71
|
}
|
|
@@ -90,7 +90,7 @@ export const getProducts = async (skus) => {
|
|
|
90
90
|
})();
|
|
91
91
|
};
|
|
92
92
|
export const getSubscriptions = async (skus) => {
|
|
93
|
-
console.warn(
|
|
93
|
+
console.warn("`getSubscriptions` is deprecated. Use `requestProducts({ skus, type: 'subs' })` instead. This function will be removed in version 3.0.0.");
|
|
94
94
|
if (!skus?.length) {
|
|
95
95
|
return Promise.reject(new Error('"skus" is required'));
|
|
96
96
|
}
|
|
@@ -187,7 +187,7 @@ export const requestProducts = async ({ skus, type = 'inapp', }) => {
|
|
|
187
187
|
* @deprecated Use `getPurchaseHistories` instead. This function will be removed in version 3.0.0.
|
|
188
188
|
*/
|
|
189
189
|
export const getPurchaseHistory = ({ alsoPublishToEventListener = false, onlyIncludeActiveItems = false, } = {}) => {
|
|
190
|
-
console.warn(
|
|
190
|
+
console.warn('`getPurchaseHistory` is deprecated. Use `getPurchaseHistories` instead. This function will be removed in version 3.0.0.');
|
|
191
191
|
return getPurchaseHistories({
|
|
192
192
|
alsoPublishToEventListener,
|
|
193
193
|
onlyIncludeActiveItems,
|
|
@@ -380,7 +380,7 @@ export const requestSubscription = async (request) => {
|
|
|
380
380
|
console.warn("`requestSubscription` is deprecated and will be removed in version 3.0.0. Use `requestPurchase({ request, type: 'subs' })` instead.");
|
|
381
381
|
return (await requestPurchase({ request, type: 'subs' }));
|
|
382
382
|
};
|
|
383
|
-
export const finishTransaction = ({ purchase, isConsumable, }) => {
|
|
383
|
+
export const finishTransaction = ({ purchase, isConsumable = false, }) => {
|
|
384
384
|
return (Platform.select({
|
|
385
385
|
ios: async () => {
|
|
386
386
|
const transactionId = purchase.transactionId;
|
|
@@ -432,6 +432,37 @@ export const getStorefront = () => {
|
|
|
432
432
|
console.warn('`getStorefront` is deprecated. Use `getStorefrontIOS` instead. This function will be removed in version 3.0.0.');
|
|
433
433
|
return getStorefrontIOS();
|
|
434
434
|
};
|
|
435
|
+
/**
|
|
436
|
+
* Internal receipt validation function (NOT RECOMMENDED for production use)
|
|
437
|
+
*
|
|
438
|
+
* WARNING: This function performs client-side validation which is NOT secure.
|
|
439
|
+
* For production apps, always validate receipts on your secure server:
|
|
440
|
+
* - iOS: Send receipt data to Apple's verification endpoint from your server
|
|
441
|
+
* - Android: Use Google Play Developer API with service account credentials
|
|
442
|
+
*/
|
|
443
|
+
export const validateReceipt = async (sku, androidOptions) => {
|
|
444
|
+
if (Platform.OS === 'ios') {
|
|
445
|
+
return await validateReceiptIOS(sku);
|
|
446
|
+
}
|
|
447
|
+
else if (Platform.OS === 'android') {
|
|
448
|
+
if (!androidOptions ||
|
|
449
|
+
!androidOptions.packageName ||
|
|
450
|
+
!androidOptions.productToken ||
|
|
451
|
+
!androidOptions.accessToken) {
|
|
452
|
+
throw new Error('Android validation requires packageName, productToken, and accessToken');
|
|
453
|
+
}
|
|
454
|
+
return await validateReceiptAndroid({
|
|
455
|
+
packageName: androidOptions.packageName,
|
|
456
|
+
productId: sku,
|
|
457
|
+
productToken: androidOptions.productToken,
|
|
458
|
+
accessToken: androidOptions.accessToken,
|
|
459
|
+
isSub: androidOptions.isSub,
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
throw new Error('Platform not supported');
|
|
464
|
+
}
|
|
465
|
+
};
|
|
435
466
|
export * from './useIap';
|
|
436
467
|
export * from './utils/errorMapping';
|
|
437
468
|
//# sourceMappingURL=index.js.map
|