Version 6.3.3 - Replacement Mode Migration & OpenIAP Updates
We're excited to announce the release of flutter_inapp_purchase version 6.3.3! This release includes important updates to align with OpenIAP specifications and Google Play Billing Library v8.
Major Changes
1. Replacement Mode Migration (Android)
We've updated our Android implementation to use the new replacementMode
terminology, replacing the deprecated prorationMode
. This aligns with Google Play Billing Library v8 naming conventions.
What's Changed
prorationMode
→replacementMode
AndroidProrationMode
enum →AndroidReplacementMode
enum- Updated enum values for better clarity:
immediateWithTimeProration
→withTimeProration
immediateAndChargeProratedPrice
→chargeProratedPrice
immediateWithoutProration
→withoutProration
immediateAndChargeFullPrice
→chargeFullPrice
Migration Example
Before (older API):
await FlutterInappPurchase.instance.requestPurchase(
request: RequestPurchase(
ios: RequestPurchaseIOS(sku: 'premium_yearly'),
android: RequestPurchaseAndroid(
skus: ['premium_yearly'],
replacementModeAndroid: AndroidProrationMode.immediateWithTimeProration,
purchaseTokenAndroid: existingSub.purchaseToken, // [DEPRECATED] Use purchaseToken instead
),
),
type: PurchaseType.subs,
);
After:
await FlutterInappPurchase.instance.requestPurchase(
request: RequestPurchase(
ios: RequestPurchaseIOS(sku: 'premium_yearly'),
android: RequestPurchaseAndroid(
skus: ['premium_yearly'],
replacementModeAndroid: AndroidReplacementMode.withTimeProration,
purchaseTokenAndroid: existingSub.purchaseToken, // [DEPRECATED] Use purchaseToken instead
),
),
type: PurchaseType.subs,
);
2. OpenIAP Specification Compliance
All types have been updated to fully comply with OpenIAP specifications:
- New base types:
ProductCommon
,PurchaseCommon
,ProductSubscriptionCommon
- Proper platform-specific type extensions
- Consistent naming conventions with platform suffixes (iOS, Android)
3. Enhanced Android Product Field Support
Added missing Android-specific fields to achieve full OpenIAP specification compliance:
nameAndroid
: The product name from Google PlayoneTimePurchaseOfferDetailsAndroid
: Structured pricing details including:priceCurrencyCode
: ISO 4217 currency codeformattedPrice
: Formatted price stringpriceAmountMicros
: Price in micro-units
These fields ensure Android products now have near 100% field compatibility with the OpenIAP specification (up from 60%).
4. Improved Null Safety
Fixed all null safety issues and InvalidType errors throughout the codebase.
Deprecation Notice - Will be removed in v6.4.0
The following items are deprecated in this release and will be removed in v6.4.0:
Android Replacement Mode
- ❌
prorationMode
parameter - ❌
prorationModeAndroid
parameter - ❌
AndroidProrationMode
enum - ✅ Use
replacementMode
,replacementModeAndroid
, andAndroidReplacementMode
instead
Purchase Fields
- ❌
transactionId
→ Useid
instead - ❌
purchaseTokenAndroid
→ UsepurchaseToken
instead - ❌
jwsRepresentationIOS
→ UsepurchaseToken
instead
iOS Product Fields
- ❌
displayName
→ UsedisplayNameIOS
instead - ❌
isFamilyShareable
→ UseisFamilyShareableIOS
instead - ❌
jsonRepresentation
→ UsejsonRepresentationIOS
instead - ❌
subscription
→ UsesubscriptionInfoIOS
instead - ❌
discounts
→ UsediscountsIOS
instead - ❌
introductoryPrice
→ UseintroductoryPriceIOS
instead
Android Product Fields
- ❌
name
→ UsenameAndroid
instead - ❌
oneTimePurchaseOfferDetails
→ UseoneTimePurchaseOfferDetailsAndroid
instead - ❌
subscriptionOfferDetails
→ UsesubscriptionOfferDetailsAndroid
instead
Methods
- ❌
DiscountIOS.fromJSON()
→ UseDiscountIOS.fromJson()
instead
Breaking Changes
None in this release. All changes are backward compatible with deprecation warnings.
Bug Fixes
- Fixed duplicate
ReplacementMode
enum definition - Resolved null safety errors in types.dart
- Fixed InvalidType errors throughout the codebase
- Corrected platform-specific field naming inconsistencies
What's Next
In version 6.4.0, we will:
- Remove all deprecated APIs listed above
- Complete the OpenIAP specification implementation
- Add support for new StoreKit 2 features
Upgrading
To upgrade to version 6.3.3:
dependencies:
flutter_inapp_purchase: ^6.3.3
Then run:
flutter pub get
Action Required
Please update your code to use the new APIs before upgrading to v6.4.0. The deprecated APIs are still functional in v6.3.3 but will be removed in the next major update.
Support
If you encounter any issues or have questions:
- Report issues at GitHub Issues
- Check the documentation
- Join our Slack community
Thank you for using flutter_inapp_purchase!