Skip to content

Commit 55738eb

Browse files
committed
2.8.6
1 parent db8df9e commit 55738eb

File tree

4 files changed

+161
-9
lines changed

4 files changed

+161
-9
lines changed

CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,80 @@
11
# CHANGELOG
22

3-
## [2.8.6] - TBD
3+
## [2.8.6]
44

55
### Changed
6+
67
- **BREAKING NAMING CONVENTION**: Added platform-specific suffixes to native functions for clarity
78
- iOS functions now use `IOS` suffix (e.g., `getPromotedProductIOS`, `clearTransactionIOS`)
89
- Android functions now use `Android` suffix (e.g., `acknowledgePurchaseAndroid`, `consumeProductAndroid`)
910
- Common cross-platform functions remain without suffix (`requestProducts`, `requestPurchase`)
1011
- Renamed `buyPromotedProductIOS` to `requestPurchaseOnPromotedProductIOS` for consistency
1112

1213
### Added
14+
1315
- Added `getPendingTransactionsIOS` function for iOS
1416
- Added `clearTransactionIOS` function for iOS
1517

1618
### Deprecated
19+
1720
- `getPurchaseHistories` - Use `getAvailablePurchases` instead (will be removed in v2.9.0)
1821
- `buyPromotedProductIOS` - Use `requestPurchaseOnPromotedProductIOS` instead (will be removed in v2.9.0)
1922
- `disable` function - No longer needed, observer management is automatic (will be removed in v2.9.0)
2023

2124
## [2.8.5] - 2025-09-03
2225

2326
### Fixed
27+
2428
- Fixed Android `finishTransaction` null error by adding fallback to `purchaseTokenAndroid` (#180)
2529

2630
## [2.8.4] - 2025-08-31
2731

2832
### Fixed
33+
2934
- Fixed iOS 18.4 properties build failure on Xcode 16.3 and below by adding Swift 6.1 compiler guard
3035

3136
### Changed
37+
3238
- Android: Enabled automatic service reconnection (Android Billing Client v8 feature) and simplified connection logic (#178)
3339

3440
## [2.8.3] - 2025-08-27
3541

3642
### Fixed
43+
3744
- Fixed TypeScript type issues
3845
- Added critical warning about iOS platform version in podspec (#169)
3946

4047
## [2.8.2] - 2025-08-26
4148

4249
### Added
50+
4351
- Added `platform` field to all IAP types for improved runtime type discrimination
4452
- Consolidated `Purchase` types and deprecated legacy type aliases for consistency
4553

4654
### Changed
55+
4756
- Refactored and consolidated Purchase types to follow OpenIAP specification
4857
- Improved type consistency across iOS and Android platforms
4958

5059
### Deprecated
60+
5161
**Note**: The following deprecated type aliases will be removed in v2.9.0:
62+
5263
- `ProductPurchase` (use `Purchase` instead)
5364
- `SubscriptionPurchase` (use `Purchase` instead)
5465

5566
## [2.8.1] - 2025-08-19
5667

5768
### Added
69+
5870
- Added `debugDescription?: string` field to `ProductCommon` for debugging purposes
5971
- Added `platform?: string` field to `ProductCommon` and `PurchaseCommon` for platform identification
6072
- Added `platform: "ios"` to iOS-specific types (`ProductIOS`, `ProductSubscriptionIOS`, `PurchaseIOS`)
6173
- Added `platform: "android"` to Android-specific types (`ProductAndroid`, `ProductSubscriptionAndroid`, `PurchaseAndroid`)
6274
- Added `ids?: string[]` field to `PurchaseCommon` (moved from Android-specific types)
6375

6476
### Changed
77+
6578
- Moved common fields from platform-specific types to shared Common types
6679
- Updated iOS native code to populate missing subscription fields:
6780
- `introductoryPriceAsAmountIOS`
@@ -73,12 +86,15 @@
7386
- Updated Android native code to use common `ids` field instead of platform-specific `idsAndroid`
7487

7588
### Fixed
89+
7690
- Fixed type mismatches between Product and Purchase types across iOS and Android platforms
7791
- Resolved missing field mappings in iOS native subscription data extraction
7892
- Improved type consistency for cross-platform compatibility
7993

8094
### Deprecated
95+
8196
**Note**: No breaking changes in this release. The following deprecated fields will be removed in v2.9.0:
97+
8298
- Android: `idsAndroid` (use common `ids` field instead)
8399
- Android: `name`, `oneTimePurchaseOfferDetails`, `subscriptionOfferDetails` (use fields with `Android` suffix)
84100
- iOS: `displayName`, `isFamilyShareable`, `jsonRepresentation`, `subscription` (use fields with `IOS` suffix)
@@ -93,6 +109,7 @@
93109
**Migration Guide**: See the full migration guide at [expo-iap.hyo.dev/blog/v2-8-0-migration-guide](https://expo-iap.hyo.dev/blog/v2-8-0-migration-guide)
94110

95111
Affected fields:
112+
96113
- `quantityIos``quantityIOS`
97114
- `expirationDateIos``expirationDateIOS`
98115
- `environmentIos``environmentIOS`

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,13 @@ For detailed usage examples and error handling, see the [documentation](https://
6969
<img width="600" alt="courier_dot_com" src="https://static.xx.fbcdn.net/rsrc.php/y3/r/y6QsbGgc866.svg" />
7070
</a>
7171

72-
### <p style="color: rgb(205, 127, 50);">Bronze</p>
73-
74-
<a href="https://www.courier.com/?utm_source=react-native-iap&utm_campaign=osssponsors">
75-
<img width="160" alt="courier_dot_com" src="https://github.com/user-attachments/assets/319d8966-6839-498d-8ead-ce8cc72c3bca" />
76-
</a>
77-
7872
## Past Supporters
7973

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>
74+
<div style="display: flex; align-items:center; gap: 10px;">
75+
<a href="https://namiml.com" style="opacity: 50%">
76+
<img src="https://github.com/hyochan/react-native-iap/assets/27461460/89d71f61-bb73-400a-83bd-fe0f96eb726e" alt="Nami ML" width="140"/>
77+
</a>
78+
<a href="https://www.courier.com/?utm_source=react-native-iap&utm_campaign=osssponsors" style="opacity: 50%;">
79+
<img width="80" alt="courier_dot_com" src="https://github.com/user-attachments/assets/319d8966-6839-498d-8ead-ce8cc72c3bca" />
80+
</a>
81+
</div>
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
slug: v2-8-6-release
3+
title: Expo IAP v2.8.6 - Platform-Specific Naming Convention
4+
authors: [hyochan]
5+
tags: [release, breaking-change, ios, android, refactoring]
6+
---
7+
8+
# Expo IAP v2.8.6 Release Notes
9+
10+
We're excited to announce the release of Expo IAP v2.8.6, which introduces important naming convention changes to improve code clarity and platform-specific function identification.
11+
12+
## 🚨 Breaking Changes
13+
14+
### Platform-Specific Function Suffixes
15+
16+
To enhance code readability and prevent confusion between platform-specific and cross-platform functions, we've standardized our naming conventions:
17+
18+
#### iOS Functions
19+
All iOS-specific functions now use the `IOS` suffix:
20+
- `getPromotedProductIOS()`
21+
- `clearTransactionIOS()`
22+
- `getPendingTransactionsIOS()` (new)
23+
- `requestPurchaseOnPromotedProductIOS()` (replaces `buyPromotedProductIOS`)
24+
25+
#### Android Functions
26+
All Android-specific functions now use the `Android` suffix:
27+
- `acknowledgePurchaseAndroid()`
28+
- `consumeProductAndroid()`
29+
- `getPackageNameAndroid()`
30+
31+
#### Cross-Platform Functions
32+
Common functions that work across both platforms remain without suffix:
33+
- `requestProducts()`
34+
- `requestPurchase()`
35+
- `requestSubscription()`
36+
- `getAvailablePurchases()`
37+
- `finishTransaction()`
38+
39+
## ✨ New Features
40+
41+
### iOS Transaction Management
42+
- **`getPendingTransactionsIOS()`**: New function to retrieve pending transactions
43+
- **`clearTransactionIOS()`**: New function to explicitly clear specific transactions
44+
45+
## 🔄 Function Renaming
46+
47+
- `buyPromotedProductIOS``requestPurchaseOnPromotedProductIOS`
48+
- Updated to use `request` prefix following OpenIAP naming conventions
49+
50+
## ⚠️ Deprecations
51+
52+
The following functions will be removed in v2.9.0:
53+
54+
- **`getPurchaseHistories()`**: Use `getAvailablePurchases()` instead
55+
- **`buyPromotedProductIOS()`**: Use `requestPurchaseOnPromotedProductIOS()` instead
56+
- **`disable()`**: No longer needed (observer management is now automatic)
57+
58+
## 🐛 Bug Fixes (v2.8.4-2.8.5)
59+
60+
### Android
61+
- Fixed `finishTransaction` null error by adding fallback to `purchaseTokenAndroid` (#180)
62+
- Improved automatic service reconnection using Android Billing Client v8 features (#178)
63+
64+
### iOS
65+
- Fixed iOS 18.4 properties build failure on Xcode 16.3 and below (added Swift 6.1 compiler guard)
66+
67+
## 📋 Migration Guide
68+
69+
### Before (v2.8.5 and earlier)
70+
```typescript
71+
import {
72+
buyPromotedProductIOS,
73+
acknowledgePurchase,
74+
consumeProduct,
75+
getPurchaseHistories
76+
} from 'expo-iap';
77+
78+
// iOS promoted product purchase
79+
await buyPromotedProductIOS();
80+
81+
// Android-specific operations (ambiguous naming)
82+
await acknowledgePurchase(purchaseToken);
83+
await consumeProduct(purchaseToken);
84+
85+
// Deprecated function
86+
const histories = await getPurchaseHistories();
87+
```
88+
89+
### After (v2.8.6+)
90+
```typescript
91+
import {
92+
requestPurchaseOnPromotedProductIOS,
93+
acknowledgePurchaseAndroid,
94+
consumeProductAndroid,
95+
getAvailablePurchases,
96+
getPendingTransactionsIOS,
97+
clearTransactionIOS
98+
} from 'expo-iap';
99+
100+
// iOS promoted product purchase (renamed)
101+
await requestPurchaseOnPromotedProductIOS();
102+
103+
// Android-specific operations (clear naming)
104+
await acknowledgePurchaseAndroid(purchaseToken);
105+
await consumeProductAndroid(purchaseToken);
106+
107+
// Use recommended function
108+
const purchases = await getAvailablePurchases();
109+
110+
// New iOS transaction management
111+
const pendingTransactions = await getPendingTransactionsIOS();
112+
await clearTransactionIOS(transactionId);
113+
```
114+
115+
## 🎯 Why These Changes?
116+
117+
1. **Clarity**: Platform-specific functions are immediately identifiable
118+
2. **Consistency**: Naming conventions align with OpenIAP specification
119+
3. **Maintainability**: Easier code review and debugging
120+
4. **Type Safety**: Improved TypeScript auto-completion
121+
122+
## 📚 Documentation
123+
124+
For detailed migration instructions, see the [Migration Guide](/docs/guides/migration-2.8.6).
125+
126+
## 🙏 Acknowledgments
127+
128+
Thank you to all contributors who made this release possible. Special thanks to those who helped resolve platform-specific type mismatches and modernize the Android billing implementation.
129+
130+
## 📝 Next Steps
131+
132+
v2.9.0 will remove deprecated functions and include additional OpenIAP specification compliance improvements. Please update your use of deprecated functions early for a smooth migration.
133+
134+
Questions and feedback are welcome at [GitHub Issues](https://github.com/hyochan/expo-iap/issues)!

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "expo-iap",
3-
"version": "2.8.5",
3+
"version": "2.8.6",
44
"description": "In App Purchase module in Expo",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",

0 commit comments

Comments
 (0)