Skip to main content

v2.8.1 Release - Type System Improvements

ยท One min read
Hyo
Expo IAP Maintainer

This release resolves type mismatches between Product and Purchase types across iOS and Android platforms.

What's Newโ€‹

Type System Improvementsโ€‹

  • Added platform field to all types for runtime type discrimination
  • Moved common fields (ids, debugDescription) to shared base types
  • Fixed iOS native code to populate missing subscription fields

No Breaking Changesโ€‹

All existing code continues to work. Update to platform-specific field names before v2.9.0:

  • Android: name โ†’ nameAndroid
  • iOS: displayName โ†’ displayNameIOS

Important Noteโ€‹

If upgrading from versions before v2.8.0, please review the v2.8.0 migration guide first, as it contains breaking changes for iOS field naming conventions.

Type Discrimination Exampleโ€‹

import {Product, Purchase} from 'expo-iap';

function handleProduct(product: Product) {
if (product.platform === 'ios') {
// TypeScript knows this is ProductIOS
console.log(product.isFamilyShareableIOS);
} else if (product.platform === 'android') {
// TypeScript knows this is ProductAndroid
console.log(product.nameAndroid);
}
}

Installationโ€‹

npm install expo-iap@2.8.1

Next Stepsโ€‹

Deprecated fields will be removed in v2.9.0. Update your code now to ensure smooth migration.

For details, see the full changelog.

v2.8.0 Migration Guide - iOS Field Naming Convention Update

ยท 4 min read
Hyo
Expo IAP Maintainer

Breaking Changesโ€‹

Version 2.8.0 introduces naming convention changes:

  1. iOS suffix convention: Fields with iOS suffixes now use uppercase IOS instead of Ios
  2. ID suffix convention: All fields ending with ID now use Id instead for consistency (e.g., subscriptionGroupID โ†’ subscriptionGroupId, bundleID โ†’ bundleId)

Note: Android field names remain unchanged as they already follow the correct convention (e.g., autoRenewingAndroid, purchaseTokenAndroid).

v2.7.3 Release - Google Play Billing Library v8.0.0 Support

ยท 2 min read
Hyo
Expo IAP Maintainer

We're excited to announce the release of expo-iap v2.7.3, which brings full support for Google Play Billing Library v8.0.0! This update ensures compatibility with the latest Android billing features and improved error handling.

๐Ÿš€ What's Newโ€‹

Google Play Billing Library v8.0.0 Supportโ€‹

  • Upgraded billing library from v7.0.0 to v8.0.0
  • Enhanced error handling with sub-response codes for better debugging
  • Improved API compatibility with updated callback signatures

Key Changesโ€‹

  • Updated queryProductDetailsAsync callback to use QueryProductDetailsResult
  • Enhanced enablePendingPurchases with proper parameter configuration
  • Removed deprecated hardcoded Kotlin version constraints

โš ๏ธ Breaking Changesโ€‹

Android Kotlin Version Requirementโ€‹

Important: Google Play Billing Library v8.0.0 requires Kotlin 2.0+, but expo-modules-core doesn't support Kotlin v2 yet. You need to configure your project with expo-build-properties:

{
"expo": {
"plugins": [
[
"expo-build-properties",
{
"android": {
"kotlinVersion": "2.0.21"
}
}
]
]
}
}

๐Ÿ“ฆ Installationโ€‹

If you're upgrading to v2.7.3:

npx expo install expo-iap@2.7.3

Don't forget to add the expo-build-properties configuration to your app.json if you haven't already!

๐Ÿ”ง Migration Guideโ€‹

For Existing Projectsโ€‹

  1. Update to expo-iap v2.7.3
  2. Add expo-build-properties plugin configuration to your app.json
  3. Run npx expo prebuild --clean to regenerate native code
  4. Test your purchase flows to ensure everything works correctly

Why This Change?โ€‹

Google Play Billing Library v8.0.0 introduces several improvements:

  • Better error handling with detailed sub-response codes
  • Enhanced product fetching with unfetched product tracking
  • Improved security and performance

However, it requires Kotlin 2.0+, which conflicts with expo-modules-core's current Kotlin version requirements. The expo-build-properties solution provides a clean workaround until expo-modules-core supports Kotlin v2.

๐Ÿ“š Documentation Updatesโ€‹

We've updated our documentation to include:

  • Android configuration section with step-by-step setup
  • Kotlin version requirement explanation
  • expo-build-properties configuration guide

Visit our installation guide for complete setup instructions.

๐Ÿ™ Acknowledgmentsโ€‹

Thanks to the community for reporting the billing library compatibility issues and helping us test the Kotlin version solutions. Your feedback makes expo-iap better for everyone!


As always, if you encounter any issues or have feedback, please open an issue on GitHub.

Happy coding! ๐ŸŽ‰