Skip to main content

Version 6.3.3 - Replacement Mode Migration & OpenIAP Updates

· 3 min read
Hyo
Maintainer of flutter_inapp_purchase & expo-iap

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

  • prorationModereplacementMode
  • AndroidProrationMode enum → AndroidReplacementMode enum
  • Updated enum values for better clarity:
    • immediateWithTimeProrationwithTimeProration
    • immediateAndChargeProratedPricechargeProratedPrice
    • immediateWithoutProrationwithoutProration
    • immediateAndChargeFullPricechargeFullPrice

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 Play
  • oneTimePurchaseOfferDetailsAndroid: Structured pricing details including:
    • priceCurrencyCode: ISO 4217 currency code
    • formattedPrice: Formatted price string
    • priceAmountMicros: 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, and AndroidReplacementMode instead

Purchase Fields

  • transactionId → Use id instead
  • purchaseTokenAndroid → Use purchaseToken instead
  • jwsRepresentationIOS → Use purchaseToken instead

iOS Product Fields

  • displayName → Use displayNameIOS instead
  • isFamilyShareable → Use isFamilyShareableIOS instead
  • jsonRepresentation → Use jsonRepresentationIOS instead
  • subscription → Use subscriptionInfoIOS instead
  • discounts → Use discountsIOS instead
  • introductoryPrice → Use introductoryPriceIOS instead

Android Product Fields

  • name → Use nameAndroid instead
  • oneTimePurchaseOfferDetails → Use oneTimePurchaseOfferDetailsAndroid instead
  • subscriptionOfferDetails → Use subscriptionOfferDetailsAndroid instead

Methods

  • DiscountIOS.fromJSON() → Use DiscountIOS.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:

Thank you for using flutter_inapp_purchase!