expo-iap 2.7.10 → 2.7.12
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/CHANGELOG.md +2 -137
- package/CLAUDE.md +55 -0
- package/CONTRIBUTING.md +118 -72
- package/README.md +18 -15
- package/android/src/main/java/expo/modules/iap/ExpoIapModule.kt +6 -5
- package/build/ExpoIap.types.d.ts +14 -53
- package/build/ExpoIap.types.d.ts.map +1 -1
- package/build/ExpoIap.types.js +1 -14
- package/build/ExpoIap.types.js.map +1 -1
- package/build/helpers/subscription.d.ts +22 -0
- package/build/helpers/subscription.d.ts.map +1 -0
- package/build/helpers/subscription.js +92 -0
- package/build/helpers/subscription.js.map +1 -0
- package/build/index.d.ts +5 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -41
- package/build/index.js.map +1 -1
- package/build/useIap.d.ts +4 -0
- package/build/useIap.d.ts.map +1 -1
- package/build/useIap.js +26 -1
- package/build/useIap.js.map +1 -1
- package/bun.lock +2493 -0
- package/ios/ExpoIapModule.swift +3 -2
- package/package.json +1 -1
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/src/ExpoIap.types.ts +16 -101
- package/src/helpers/subscription.ts +122 -0
- package/src/index.ts +20 -54
- package/src/useIap.ts +41 -0
- package/bun.lockb +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,138 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CHANGELOG
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
### Fixed
|
|
6
|
-
|
|
7
|
-
- Fixed `acknowledgePurchaseAndroid` argument mismatch error by removing unused `developerPayload` parameter
|
|
8
|
-
|
|
9
|
-
## [2.7.8]
|
|
10
|
-
|
|
11
|
-
### Added
|
|
12
|
-
|
|
13
|
-
- Exported `validateReceipt` function from main API with security warnings
|
|
14
|
-
- Documentation about iOS unfinished transactions behavior
|
|
15
|
-
- Documentation about Android 3-day acknowledgment requirement
|
|
16
|
-
|
|
17
|
-
### Fixed
|
|
18
|
-
|
|
19
|
-
- Documentation incorrectly stating Android auto-validates receipts
|
|
20
|
-
- Added explicit `isConsumable: false` default value in `finishTransaction`
|
|
21
|
-
- Markdownlint warnings (MD032, MD033, MD024)
|
|
22
|
-
|
|
23
|
-
### Changed
|
|
24
|
-
|
|
25
|
-
- Moved `validateReceipt` from hook-only to main exports
|
|
26
|
-
- Enhanced security warnings for client-side receipt validation
|
|
27
|
-
- Updated troubleshooting guide with `onPurchaseSuccess` auto-trigger issue
|
|
28
|
-
|
|
29
|
-
### Documentation
|
|
30
|
-
|
|
31
|
-
- Added comprehensive guide for handling unfinished transactions
|
|
32
|
-
- Clarified platform-specific transaction acknowledgment behavior
|
|
33
|
-
- Emphasized server-side validation requirement for both iOS and Android
|
|
34
|
-
|
|
35
|
-
## [2.7.7]
|
|
36
|
-
|
|
37
|
-
### Fixed
|
|
38
|
-
|
|
39
|
-
- iOS: Fixed hot reload issues with concurrent StoreKit operations
|
|
40
|
-
- iOS: Resolved race conditions in `Promise.all` usage
|
|
41
|
-
- iOS: Improved state cleanup on `initConnection()`
|
|
42
|
-
- Fixed `useIAP` hook's internal methods to use `requestProducts` instead of deprecated `getSubscriptions`
|
|
43
|
-
|
|
44
|
-
### Changed
|
|
45
|
-
|
|
46
|
-
- iOS: Added `ensureConnection()` pattern matching Android
|
|
47
|
-
- iOS: Simplified module architecture
|
|
48
|
-
|
|
49
|
-
## [2.7.6] - 2025-08-01
|
|
50
|
-
|
|
51
|
-
### Fixed
|
|
52
|
-
|
|
53
|
-
- Fixed `initConnection()` return type
|
|
54
|
-
|
|
55
|
-
### Documentation
|
|
56
|
-
|
|
57
|
-
- Added available-purchases example
|
|
58
|
-
- Improved build error FAQs
|
|
59
|
-
- Enhanced setup documentation
|
|
60
|
-
|
|
61
|
-
## [2.7.5] - 2025-07-24
|
|
62
|
-
|
|
63
|
-
### Added
|
|
64
|
-
|
|
65
|
-
- iOS promoted product support
|
|
66
|
-
- `promotedProductListenerIOS()`, `getPromotedProductIOS()`, `buyPromotedProductIOS()` methods
|
|
67
|
-
- Promoted product support in useIAP hook
|
|
68
|
-
|
|
69
|
-
### Changed
|
|
70
|
-
|
|
71
|
-
- Promoted product listener now returns full Product object
|
|
72
|
-
- Updated documentation and examples
|
|
73
|
-
|
|
74
|
-
### Fixed
|
|
75
|
-
|
|
76
|
-
- iOS build error in promoted product handler
|
|
77
|
-
- Type safety improvements
|
|
78
|
-
|
|
79
|
-
## [2.7.4] - 2025-07-24
|
|
80
|
-
|
|
81
|
-
### Fixed
|
|
82
|
-
|
|
83
|
-
- iOS 18.4+ availability check for `appTransactionID`
|
|
84
|
-
- TypeScript compatibility for older iOS versions
|
|
85
|
-
|
|
86
|
-
## [2.7.3] - 2025-07-23
|
|
87
|
-
|
|
88
|
-
### Fixed
|
|
89
|
-
|
|
90
|
-
- Android Google Play Billing Library v8.0.0 upgrade
|
|
91
|
-
- Kotlin version compatibility
|
|
92
|
-
|
|
93
|
-
### Changed
|
|
94
|
-
|
|
95
|
-
- Android requires Kotlin 2.0+
|
|
96
|
-
- Added expo-build-properties requirement
|
|
97
|
-
|
|
98
|
-
### Documentation
|
|
99
|
-
|
|
100
|
-
- Android configuration guide
|
|
101
|
-
- Kotlin version requirements
|
|
102
|
-
|
|
103
|
-
## [2.7.2] - 2025-07-22
|
|
104
|
-
|
|
105
|
-
### Added
|
|
106
|
-
|
|
107
|
-
- iOS 16.0+ app transaction support
|
|
108
|
-
|
|
109
|
-
## [2.7.1] - 2025-07-22
|
|
110
|
-
|
|
111
|
-
### Fixed
|
|
112
|
-
|
|
113
|
-
- Added missing `requestProducts()` API
|
|
114
|
-
- Fixed `getStorefrontIOS()` platform handling
|
|
115
|
-
- Documentation build fixes
|
|
116
|
-
|
|
117
|
-
### Changed
|
|
118
|
-
|
|
119
|
-
- Added deprecation warnings to `getProducts()` and `getSubscriptions()`
|
|
120
|
-
|
|
121
|
-
## [2.7.0] - 2025-07-22
|
|
122
|
-
|
|
123
|
-
### Added
|
|
124
|
-
|
|
125
|
-
- Platform-specific API for `requestPurchase`
|
|
126
|
-
- Google Play Billing Library v8.0.0 support
|
|
127
|
-
- Android automatic reconnection
|
|
128
|
-
- Detailed error codes
|
|
129
|
-
|
|
130
|
-
### Changed
|
|
131
|
-
|
|
132
|
-
- Deprecated `requestSubscription`
|
|
133
|
-
- Removed Android `getPurchaseHistory()`
|
|
134
|
-
|
|
135
|
-
### Breaking Changes
|
|
136
|
-
|
|
137
|
-
- Android: `getPurchaseHistory()` removed
|
|
138
|
-
- Android: Requires Google Play Billing v8.0.0
|
|
3
|
+
Checkout [Release Notes](https://github.com/hyochan/expo-iap/releases)
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Implementation Guidelines
|
|
2
|
+
|
|
3
|
+
## Expo-Specific Guidelines
|
|
4
|
+
|
|
5
|
+
### Pre-Commit Checks
|
|
6
|
+
|
|
7
|
+
Before committing any changes:
|
|
8
|
+
|
|
9
|
+
1. Run `bun run lint` to ensure code quality
|
|
10
|
+
2. Run `bun run typecheck` to verify TypeScript types
|
|
11
|
+
3. Run `bun run test` to verify all tests pass (Note: Use `bun run test`, not `bun test`)
|
|
12
|
+
4. **IMPORTANT**: Run tests in the example directory as well:
|
|
13
|
+
- `cd example && bun run test`
|
|
14
|
+
- Ensure all tests pass with 100% success rate
|
|
15
|
+
- Fix any failing tests before committing
|
|
16
|
+
5. Only commit if all checks succeed
|
|
17
|
+
|
|
18
|
+
### Platform-Specific Naming Conventions
|
|
19
|
+
|
|
20
|
+
- **iOS-related code**: Use `Ios` in naming (e.g., `PurchaseIos`, `SubscriptionOfferIos`)
|
|
21
|
+
- **Android-related code**: Use `Android` in naming (e.g., `PurchaseAndroid`, `SubscriptionOfferAndroid`)
|
|
22
|
+
- **IAP-related code**: Use `Iap` in naming (e.g., `IapPurchase`, not `IAPPurchase`)
|
|
23
|
+
- This applies to both functions, types, and file names
|
|
24
|
+
|
|
25
|
+
### React/JSX Conventions
|
|
26
|
+
|
|
27
|
+
- **Conditional Rendering**: Use ternary operator with null instead of logical AND
|
|
28
|
+
- ✅ Good: `{condition ? <Component /> : null}`
|
|
29
|
+
- ❌ Avoid: `{condition && <Component />}`
|
|
30
|
+
|
|
31
|
+
### API Method Naming
|
|
32
|
+
|
|
33
|
+
- Functions that depend on event results should use `request` prefix (e.g., `requestPurchase`, `requestSubscription`)
|
|
34
|
+
- Follow OpenIAP terminology: <https://www.openiap.dev/docs/apis#terminology>
|
|
35
|
+
- Do not use generic prefixes like `get`, `find` - refer to the official terminology
|
|
36
|
+
|
|
37
|
+
## IAP-Specific Guidelines
|
|
38
|
+
|
|
39
|
+
### OpenIAP Specification
|
|
40
|
+
|
|
41
|
+
All implementations must follow the OpenIAP specification:
|
|
42
|
+
|
|
43
|
+
- **APIs**: <https://www.openiap.dev/docs/apis>
|
|
44
|
+
- **Types**: <https://www.openiap.dev/docs/types>
|
|
45
|
+
- **Events**: <https://www.openiap.dev/docs/events>
|
|
46
|
+
- **Errors**: <https://www.openiap.dev/docs/errors>
|
|
47
|
+
|
|
48
|
+
### Feature Development Process
|
|
49
|
+
|
|
50
|
+
For new feature proposals:
|
|
51
|
+
|
|
52
|
+
1. Before implementing, discuss at: <https://github.com/hyochan/openiap.dev/discussions>
|
|
53
|
+
2. Get community feedback and consensus
|
|
54
|
+
3. Ensure alignment with OpenIAP standards
|
|
55
|
+
4. Implement following the agreed specification
|
package/CONTRIBUTING.md
CHANGED
|
@@ -4,13 +4,16 @@ Thank you for your interest in contributing to expo-iap! This guide will help yo
|
|
|
4
4
|
|
|
5
5
|
## 📋 Table of Contents
|
|
6
6
|
|
|
7
|
-
- [Development Setup](
|
|
8
|
-
- [Package Manager](
|
|
9
|
-
- [Running the Example App](
|
|
10
|
-
- [Development Guidelines](
|
|
11
|
-
- [Testing](
|
|
12
|
-
- [Code Style](
|
|
13
|
-
- [Submitting Changes](
|
|
7
|
+
- [Development Setup](#-development-setup)
|
|
8
|
+
- [Package Manager](#-package-manager)
|
|
9
|
+
- [Running the Example App](#-running-the-example-app)
|
|
10
|
+
- [Development Guidelines](#-development-guidelines)
|
|
11
|
+
- [Testing](#-testing)
|
|
12
|
+
- [Code Style](#-code-style)
|
|
13
|
+
- [Submitting Changes](#-submitting-changes)
|
|
14
|
+
- [Reporting Issues](#-reporting-issues)
|
|
15
|
+
- [Feature Requests](#-feature-requests)
|
|
16
|
+
- [Additional Resources](#-additional-resources)
|
|
14
17
|
|
|
15
18
|
## 🚀 Development Setup
|
|
16
19
|
|
|
@@ -31,7 +34,7 @@ git clone https://github.com/hyochan/expo-iap.git
|
|
|
31
34
|
cd expo-iap
|
|
32
35
|
```
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
1. Install dependencies using Bun:
|
|
35
38
|
|
|
36
39
|
```bash
|
|
37
40
|
bun install
|
|
@@ -43,14 +46,15 @@ This project includes VSCode configurations for easier development:
|
|
|
43
46
|
|
|
44
47
|
1. **Install recommended extensions**: When you open the project in VSCode, you'll be prompted to install recommended extensions. Accept to install them.
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
1. **Use Debug Configurations**: Press `F5` or go to Run → Start Debugging and select:
|
|
47
50
|
|
|
48
51
|
- `Debug iOS (Expo)` - Runs the example app on iOS simulator
|
|
49
52
|
- `Debug Android (Expo)` - Runs the example app on Android emulator
|
|
50
53
|
- `iOS + Metro` - Starts Metro bundler and iOS app together
|
|
51
54
|
- `Android + Metro` - Starts Metro bundler and Android app together
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
1. **Use Tasks**: Press `Cmd+Shift+P` → `Tasks: Run Task` to access:
|
|
57
|
+
|
|
54
58
|
- `Start iOS Simulator` - Opens iOS Simulator
|
|
55
59
|
- `Start Android Emulator` - Starts Android emulator
|
|
56
60
|
- `Install Pods (iOS)` - Installs CocoaPods dependencies
|
|
@@ -73,9 +77,9 @@ This project includes VSCode configurations for easier development:
|
|
|
73
77
|
|
|
74
78
|
## 🧪 Running the Example App
|
|
75
79
|
|
|
76
|
-
The example app
|
|
80
|
+
The example app demonstrates all library features and is essential for testing your changes during development.
|
|
77
81
|
|
|
78
|
-
### Setup
|
|
82
|
+
### Initial Setup
|
|
79
83
|
|
|
80
84
|
1. Navigate to the example directory:
|
|
81
85
|
|
|
@@ -83,60 +87,89 @@ The example app is a great way to test your changes and see the library in actio
|
|
|
83
87
|
cd example
|
|
84
88
|
```
|
|
85
89
|
|
|
86
|
-
|
|
90
|
+
1. Install example app dependencies:
|
|
87
91
|
|
|
88
92
|
```bash
|
|
89
93
|
bun install
|
|
90
94
|
```
|
|
91
95
|
|
|
92
|
-
|
|
96
|
+
1. **iOS Setup** (macOS only):
|
|
93
97
|
|
|
94
98
|
```bash
|
|
99
|
+
# Install CocoaPods dependencies
|
|
95
100
|
cd ios
|
|
96
101
|
pod install
|
|
97
102
|
cd ..
|
|
98
103
|
```
|
|
99
104
|
|
|
100
|
-
|
|
105
|
+
1. **Android Setup**:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Ensure Android SDK is configured
|
|
109
|
+
# Set ANDROID_HOME environment variable if not already set
|
|
110
|
+
export ANDROID_HOME=$HOME/Library/Android/sdk
|
|
111
|
+
export PATH=$PATH:$ANDROID_HOME/emulator
|
|
112
|
+
export PATH=$PATH:$ANDROID_HOME/platform-tools
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Running on iOS
|
|
101
116
|
|
|
102
|
-
####
|
|
117
|
+
#### Using Expo CLI (Recommended)
|
|
103
118
|
|
|
104
119
|
```bash
|
|
105
120
|
bun run ios
|
|
121
|
+
# Or specify a device
|
|
122
|
+
bun run ios --device "iPhone 15 Pro"
|
|
106
123
|
```
|
|
107
124
|
|
|
108
|
-
|
|
125
|
+
#### Using Xcode
|
|
109
126
|
|
|
110
127
|
```bash
|
|
111
|
-
|
|
128
|
+
# Open the workspace in Xcode
|
|
129
|
+
open ios/expoiapexample.xcworkspace
|
|
112
130
|
```
|
|
113
131
|
|
|
114
|
-
|
|
132
|
+
Then select a simulator or device and press Run (⌘R).
|
|
133
|
+
|
|
134
|
+
#### Troubleshooting iOS
|
|
115
135
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
136
|
+
- **Build errors**: Clean build folder in Xcode (Shift+⌘K)
|
|
137
|
+
- **Pod issues**: `cd ios && pod deintegrate && pod install`
|
|
138
|
+
- **Metro issues**: `bun start --reset-cache`
|
|
119
139
|
|
|
120
|
-
|
|
140
|
+
### Running on Android
|
|
141
|
+
|
|
142
|
+
#### Using Expo CLI (Recommended)
|
|
121
143
|
|
|
122
144
|
```bash
|
|
123
145
|
bun run android
|
|
146
|
+
# Or specify a device
|
|
147
|
+
bun run android --device "Pixel_7_API_34"
|
|
124
148
|
```
|
|
125
149
|
|
|
126
|
-
|
|
150
|
+
#### Using Android Studio
|
|
127
151
|
|
|
128
152
|
```bash
|
|
153
|
+
# Open the project in Android Studio
|
|
129
154
|
open -a "Android Studio" android
|
|
130
155
|
```
|
|
131
156
|
|
|
132
|
-
|
|
157
|
+
Then select an emulator or device and press Run.
|
|
158
|
+
|
|
159
|
+
#### Troubleshooting Android
|
|
160
|
+
|
|
161
|
+
- **Gradle issues**: `cd android && ./gradlew clean`
|
|
162
|
+
- **Emulator not starting**: Start it manually from Android Studio
|
|
163
|
+
- **Connection issues**: `adb reverse tcp:8081 tcp:8081`
|
|
133
164
|
|
|
134
165
|
### Development Server
|
|
135
166
|
|
|
136
|
-
|
|
167
|
+
The Metro bundler is automatically started when running the app. To start it manually:
|
|
137
168
|
|
|
138
169
|
```bash
|
|
139
170
|
bun start
|
|
171
|
+
# Or with cache reset
|
|
172
|
+
bun start --reset-cache
|
|
140
173
|
```
|
|
141
174
|
|
|
142
175
|
### Available Scripts
|
|
@@ -171,44 +204,57 @@ bun run reset-project
|
|
|
171
204
|
|
|
172
205
|
## 📖 Development Guidelines
|
|
173
206
|
|
|
174
|
-
###
|
|
207
|
+
### Code Conventions and Standards
|
|
175
208
|
|
|
176
|
-
|
|
209
|
+
For detailed code conventions, naming standards, and implementation guidelines, please refer to [CLAUDE.md](./CLAUDE.md). This includes:
|
|
177
210
|
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
211
|
+
- Platform-specific naming conventions
|
|
212
|
+
- API method naming patterns
|
|
213
|
+
- Pre-commit checks
|
|
214
|
+
- OpenIAP specification compliance
|
|
181
215
|
|
|
182
|
-
|
|
216
|
+
### Development Workflow
|
|
183
217
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
export const getAppTransactionIos = async (): Promise<AppTransactionIOS | null> => { ... }
|
|
190
|
-
|
|
191
|
-
// ✅ Good - Cross-platform function without suffix
|
|
192
|
-
export const requestProducts = async (params: { skus: string[], type?: 'inapp' | 'subs' }) => {
|
|
193
|
-
return Platform.select({
|
|
194
|
-
ios: async () => { /* iOS implementation */ },
|
|
195
|
-
android: async () => { /* Android implementation */ },
|
|
196
|
-
})();
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// ❌ Bad - Platform-specific function without suffix
|
|
200
|
-
export const getStorefront = async () => { ... } // Only works on iOS, should be getStorefrontIos
|
|
201
|
-
```
|
|
218
|
+
1. **Before starting work**:
|
|
219
|
+
|
|
220
|
+
- Pull latest changes from main branch
|
|
221
|
+
- Create a feature branch: `git checkout -b feature/your-feature`
|
|
222
|
+
- Review [CLAUDE.md](./CLAUDE.md) for coding standards
|
|
202
223
|
|
|
203
|
-
|
|
224
|
+
1. **During development**:
|
|
204
225
|
|
|
205
|
-
-
|
|
206
|
-
-
|
|
226
|
+
- Make changes to the library source code in `src/`
|
|
227
|
+
- Test changes in the example app
|
|
228
|
+
- Write/update tests as needed
|
|
229
|
+
- Keep commits atomic and well-described
|
|
230
|
+
|
|
231
|
+
1. **Before committing**:
|
|
232
|
+
|
|
233
|
+
- Follow the pre-commit checks outlined in [CLAUDE.md](./CLAUDE.md)
|
|
234
|
+
- Ensure all checks pass
|
|
235
|
+
|
|
236
|
+
1. **Testing your changes**:
|
|
237
|
+
|
|
238
|
+
- The example app automatically uses the local library code
|
|
239
|
+
- Changes to `src/` will be reflected after reloading the app
|
|
240
|
+
- Test on both iOS and Android platforms when possible
|
|
241
|
+
|
|
242
|
+
### Code Conventions
|
|
243
|
+
|
|
244
|
+
For all code conventions including:
|
|
245
|
+
|
|
246
|
+
- Platform-specific naming conventions
|
|
247
|
+
- Type naming conventions
|
|
248
|
+
- API method naming patterns
|
|
249
|
+
- OpenIAP specification compliance
|
|
250
|
+
|
|
251
|
+
Please refer to [CLAUDE.md](./CLAUDE.md).
|
|
207
252
|
|
|
208
253
|
### AI Development Tools
|
|
209
254
|
|
|
210
255
|
We provide configuration files for AI-powered development tools:
|
|
211
256
|
|
|
257
|
+
- `CLAUDE.md` - Comprehensive guidelines for Claude and other AI assistants
|
|
212
258
|
- `.cursorrules` - Rules for Cursor IDE
|
|
213
259
|
- `.copilot-instructions.md` - Instructions for GitHub Copilot
|
|
214
260
|
|
|
@@ -241,12 +287,12 @@ bun run test:coverage
|
|
|
241
287
|
Example test structure:
|
|
242
288
|
|
|
243
289
|
```typescript
|
|
244
|
-
import {
|
|
290
|
+
import {render, fireEvent} from '@testing-library/react-native';
|
|
245
291
|
import MyComponent from '../MyComponent';
|
|
246
292
|
|
|
247
293
|
describe('MyComponent', () => {
|
|
248
294
|
it('should render correctly', () => {
|
|
249
|
-
const {
|
|
295
|
+
const {getByText} = render(<MyComponent />);
|
|
250
296
|
expect(getByText('Expected Text')).toBeTruthy();
|
|
251
297
|
});
|
|
252
298
|
});
|
|
@@ -296,7 +342,7 @@ bun run lint:prettier
|
|
|
296
342
|
|
|
297
343
|
Follow conventional commit format:
|
|
298
344
|
|
|
299
|
-
```
|
|
345
|
+
```text
|
|
300
346
|
type(scope): subject
|
|
301
347
|
|
|
302
348
|
body
|
|
@@ -306,17 +352,17 @@ footer
|
|
|
306
352
|
|
|
307
353
|
Types:
|
|
308
354
|
|
|
309
|
-
- `feat`:
|
|
310
|
-
- `fix`:
|
|
311
|
-
- `docs`:
|
|
312
|
-
- `style`:
|
|
313
|
-
- `refactor`:
|
|
314
|
-
- `test`:
|
|
315
|
-
- `chore`:
|
|
355
|
+
- `feat`: new feature
|
|
356
|
+
- `fix`: bug fix
|
|
357
|
+
- `docs`: documentation changes
|
|
358
|
+
- `style`: code style changes (formatting, etc.)
|
|
359
|
+
- `refactor`: code refactoring
|
|
360
|
+
- `test`: test additions or modifications
|
|
361
|
+
- `chore`: maintenance tasks
|
|
316
362
|
|
|
317
363
|
Example:
|
|
318
364
|
|
|
319
|
-
```
|
|
365
|
+
```text
|
|
320
366
|
feat(ios): add getStorefrontIos function
|
|
321
367
|
|
|
322
368
|
Implements iOS-specific storefront retrieval using StoreKit.
|
|
@@ -328,13 +374,14 @@ Closes #123
|
|
|
328
374
|
### Pull Request Process
|
|
329
375
|
|
|
330
376
|
1. Fork the repository
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
377
|
+
1. Create a feature branch: `git checkout -b feature/your-feature`
|
|
378
|
+
1. Make your changes following the guidelines above
|
|
379
|
+
1. Run tests and ensure they pass: `cd example && bun test`
|
|
380
|
+
1. Run linting: `bun run lint:ci`
|
|
381
|
+
1. Commit your changes with a descriptive message
|
|
382
|
+
1. Push to your fork
|
|
383
|
+
1. Create a Pull Request with:
|
|
384
|
+
|
|
338
385
|
- Clear description of changes
|
|
339
386
|
- Any breaking changes noted
|
|
340
387
|
- Tests for new functionality
|
|
@@ -373,6 +420,5 @@ We welcome feature requests! Please:
|
|
|
373
420
|
- [Documentation Site](https://expo-iap.hyo.dev)
|
|
374
421
|
- [API Reference](https://expo-iap.hyo.dev/docs/api/use-iap)
|
|
375
422
|
- [Example App](./example)
|
|
376
|
-
- [Platform-Specific Guidelines](./docs/PLATFORM_NAMING.md)
|
|
377
423
|
|
|
378
424
|
Thank you for contributing to expo-iap! 🎉
|
package/README.md
CHANGED
|
@@ -2,23 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
<img src="https://expo-iap.hyo.dev/img/icon.png" alt="Expo IAP Logo" width="150" />
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
[](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)
|
|
7
|
+
|
|
8
|
+
In app purchase module in [Expo](https://docs.expo.dev/guides/in-app-purchases) that conforms to the [Open IAP specification](https://openiap.dev)
|
|
9
|
+
|
|
10
|
+
<a href="https://openiap.dev"><img src="https://openiap.dev/logo.png" alt="Open IAP" height="40" /></a>
|
|
7
11
|
</div>
|
|
8
12
|
|
|
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)
|
|
10
|
-
|
|
11
13
|
## 📚 Documentation
|
|
12
14
|
|
|
13
15
|
**[📖 Visit our comprehensive documentation site →](https://expo-iap.hyo.dev)**
|
|
14
16
|
|
|
15
|
-
- [🚀 Quick Start Guide](https://expo-iap.hyo.dev/docs/intro)
|
|
16
|
-
- [💽 Installation](https://expo-iap.hyo.dev/docs/installation)
|
|
17
|
-
- [🍎 iOS Setup](https://expo-iap.hyo.dev/docs/getting-started/setup-ios)
|
|
18
|
-
- [🤖 Android Setup](https://expo-iap.hyo.dev/docs/getting-started/setup-android)
|
|
19
|
-
- [🎣 useIAP Hook API](https://expo-iap.hyo.dev/docs/api/use-iap)
|
|
20
|
-
- [⚠️ Error Codes](https://expo-iap.hyo.dev/docs/api/error-codes)
|
|
21
|
-
|
|
22
17
|
## Notice
|
|
23
18
|
|
|
24
19
|
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.
|
|
@@ -66,12 +61,20 @@ For detailed usage examples and error handling, see the [documentation](https://
|
|
|
66
61
|
|
|
67
62
|
## Sponsors
|
|
68
63
|
|
|
69
|
-
|
|
64
|
+
💼 **[View Our Sponsors](https://openiap.dev/sponsors)**
|
|
65
|
+
|
|
66
|
+
### <p style="color: rgb(255, 182, 193);">Angel</p>
|
|
67
|
+
|
|
68
|
+
<a href="https://meta.com">
|
|
69
|
+
<img width="600" alt="courier_dot_com" src="https://static.xx.fbcdn.net/rsrc.php/y3/r/y6QsbGgc866.svg" />
|
|
70
|
+
</a>
|
|
71
|
+
|
|
72
|
+
### <p style="color: rgb(205, 127, 50);">Bronze</p>
|
|
70
73
|
|
|
71
74
|
<a href="https://www.courier.com/?utm_source=react-native-iap&utm_campaign=osssponsors">
|
|
72
|
-
<img width="
|
|
75
|
+
<img width="160" alt="courier_dot_com" src="https://github.com/user-attachments/assets/319d8966-6839-498d-8ead-ce8cc72c3bca" />
|
|
73
76
|
</a>
|
|
74
77
|
|
|
75
|
-
## Past
|
|
78
|
+
## Past Supporters
|
|
76
79
|
|
|
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="
|
|
80
|
+
<a href="https://namiml.com" style="opacity: 50%"><img src="https://github.com/hyochan/react-native-iap/assets/27461460/89d71f61-bb73-400a-83bd-fe0f96eb726e" alt="Nami ML" width="140"/></a>
|
|
@@ -86,9 +86,10 @@ class ExpoIapModule :
|
|
|
86
86
|
purchases.forEach { purchase ->
|
|
87
87
|
val item =
|
|
88
88
|
mutableMapOf<String, Any?>(
|
|
89
|
-
"id" to purchase.
|
|
89
|
+
"id" to purchase.orderId,
|
|
90
|
+
"productId" to purchase.products.firstOrNull() as Any?,
|
|
90
91
|
"ids" to purchase.products,
|
|
91
|
-
"transactionId" to purchase.orderId,
|
|
92
|
+
"transactionId" to purchase.orderId, // @deprecated - use id instead
|
|
92
93
|
"transactionDate" to purchase.purchaseTime.toDouble(),
|
|
93
94
|
"transactionReceipt" to purchase.originalJson,
|
|
94
95
|
"purchaseTokenAndroid" to purchase.purchaseToken,
|
|
@@ -260,10 +261,10 @@ class ExpoIapModule :
|
|
|
260
261
|
purchases?.forEach { purchase ->
|
|
261
262
|
val item =
|
|
262
263
|
mutableMapOf<String, Any?>(
|
|
263
|
-
|
|
264
|
-
"
|
|
264
|
+
"id" to purchase.orderId,
|
|
265
|
+
"productId" to purchase.products.firstOrNull() as Any?,
|
|
265
266
|
"ids" to purchase.products,
|
|
266
|
-
"transactionId" to purchase.orderId,
|
|
267
|
+
"transactionId" to purchase.orderId, // @deprecated - use id instead
|
|
267
268
|
"transactionDate" to purchase.purchaseTime.toDouble(),
|
|
268
269
|
"transactionReceipt" to purchase.originalJson,
|
|
269
270
|
"orderId" to purchase.orderId,
|