14.6.3 - Advanced Commerce Data & Platform Field Updates
14.6.3 brings advancedCommerceData support for iOS attribution tracking using StoreKit 2's Product.PurchaseOption.custom, along with updated platform field naming conventions and improved type safety for Billing Programs API.
What's New
Advanced Commerce Data for iOS
This release adds support for advancedCommerceData in iOS purchase requests, enabling attribution tracking through StoreKit 2's custom purchase options.
import {requestPurchase} from 'react-native-iap';
await requestPurchase({
request: {
apple: {
sku: 'com.example.premium',
advancedCommerceData: 'your-attribution-token-here',
},
},
type: 'in-app',
});
This feature allows you to pass attribution data to Apple for analytics and marketing attribution purposes. The data is passed through StoreKit 2's Product.PurchaseOption.custom API.
New Platform Field Naming: apple and google
We've introduced new, clearer platform field names for purchase requests:
apple(replacesios)google(replacesandroid)
Before (deprecated):
await requestPurchase({
request: {
ios: {sku: 'premium_monthly'},
android: {skus: ['premium_monthly']},
},
type: 'in-app',
});
After (recommended):
await requestPurchase({
request: {
apple: {sku: 'premium_monthly'},
google: {skus: ['premium_monthly']},
},
type: 'in-app',
});
The old ios and android fields are still supported for backward compatibility but are now deprecated. We recommend migrating to the new field names.
Deprecated: requestPurchaseOnPromotedProductIOS
The requestPurchaseOnPromotedProductIOS() function is now deprecated. In StoreKit 2, promoted products can be purchased directly via the standard requestPurchase() flow.
Before (deprecated):
// Old approach
await requestPurchaseOnPromotedProductIOS();
After (recommended):
import {promotedProductListenerIOS, requestPurchase} from 'react-native-iap';
// Listen for promoted product taps
promotedProductListenerIOS(async (product) => {
await requestPurchase({
request: {apple: {sku: product.id}},
type: 'in-app',
});
});
This approach gives you more control over the purchase flow and integrates better with your existing error handling and UI logic.
Improved Type Safety for Billing Programs API
The Billing Programs API functions now use MutationField types for better type inference:
// These functions now have improved type safety
isBillingProgramAvailableAndroid('external-offer');
createBillingProgramReportingDetailsAndroid('external-offer');
launchExternalLinkAndroid({...});
OpenIAP Updates
- openiap-apple: 1.3.2 → 1.3.7
- openiap-google: 1.3.14 → 1.3.16
- openiap-gql: 1.3.4 → 1.3.8
Migration Guide
Platform Fields
Update your purchase requests to use the new field names:
await requestPurchase({
request: {
- ios: {sku: 'product_id'},
- android: {skus: ['product_id']},
+ apple: {sku: 'product_id'},
+ google: {skus: ['product_id']},
},
type: 'in-app',
});
Promoted Products (iOS)
Replace requestPurchaseOnPromotedProductIOS() with the listener pattern:
- await requestPurchaseOnPromotedProductIOS();
+ promotedProductListenerIOS(async (product) => {
+ await requestPurchase({
+ request: {apple: {sku: product.id}},
+ type: 'in-app',
+ });
+ });
Installation
npm install react-native-iap react-native-nitro-modules
# or
yarn add react-native-iap react-native-nitro-modules
# or
bun add react-native-iap react-native-nitro-modules
Check out the documentation for details on all features.
Questions or feedback? Reach out via GitHub issues.
