Skip to main content

3.4.12 - Cross-Platform Subscription Refresh & Reconnect

· 2 min read
Hyo
Expo IAP Maintainer

Expo IAP 3.4.12 fixes subscription refresh to work on all platforms (not just iOS), corrects a field mismatch bug in the refresh logic, forwards PurchaseOptions properly, and adds a reconnect method for manual connection retry.

Bug Fixes

Cross-Platform Subscription Refresh (#330)

The purchaseUpdatedListener inside useIAP was gated behind an iOS-only check ('expirationDateIOS' in purchase), so subscription status was never refreshed on Android after a purchase. The refresh is now called unconditionally for all platforms — refreshSubscriptionStatus already checks internally whether the product is a known subscription, so this is safe.

Additionally, refreshSubscriptionStatus now also calls getActiveSubscriptionsInternal() so that the activeSubscriptions state is kept in sync after a purchase event.

Use purchase.productId Instead of purchase.id (#330)

refreshSubscriptionStatus was receiving purchase.id (a unique transaction identifier) instead of purchase.productId (the product SKU). Since it compares against sub.id in the subscriptions list, the lookup always failed silently. Fixed to use purchase.productId.

Forward PurchaseOptions in getAvailablePurchases and restorePurchases (#331)

getAvailablePurchasesInternal and restorePurchasesInternal now accept and forward PurchaseOptions (e.g., alsoPublishToEventListenerIOS, onlyIncludeActiveItemsIOS, includeSuspendedAndroid) so callers can control platform-specific behavior.

New Features

reconnect Method (#332)

Added a reconnect() method to the useIAP hook for manual connection retry when the initial auto-connect fails. This is useful for scenarios like network errors on app launch where you want to offer users a retry button.

const {connected, reconnect} = useIAP();

const handleRetry = async () => {
const success = await reconnect();
if (success) {
console.log('Reconnected to store');
}
};

reconnect re-registers event listeners if they were cleaned up during a previous failure, and reuses a shared buildConnectionConfig helper to avoid config duplication.

Installation

# bun
bun add expo-iap@3.4.12

# npm
npm install expo-iap@3.4.12

# yarn
yarn add expo-iap@3.4.12

References