How to Add In-App Purchases to React Native
In-app purchases in React Native with RevenueCat. One SDK for iOS and Android. Subscriptions, one-time purchases, entitlement checks. Skip the 28 hours of manual billing code.
In-app purchases in React Native with RevenueCat. One SDK for iOS and Android. Subscriptions, one-time purchases, entitlement checks. Skip the 28 hours of manual billing code.
In-app purchases in React Native. One SDK, both platforms. Skip 28 hours of manual billing work.
Prerequisites
I tried implementing StoreKit 2 + Google Play Billing directly. 28 hours. Broken edge cases everywhere. Switched to RevenueCat. Working in 2 hours.
Unless you have a specific reason to handle billing yourself, use RevenueCat.
Free tier: up to $2,500/month revenue. Enough for most indie apps.
In App Store Connect:
In Google Play Console:
In RevenueCat dashboard:
npx expo install react-native-purchases
import Purchases from 'react-native-purchases';
import { Platform } from 'react-native';
await Purchases.configure({
apiKey: Platform.OS === 'ios'
? 'appl_your_ios_key'
: 'goog_your_android_key',
});
const offerings = await Purchases.getOfferings();
const currentOffering = offerings.current;
if (currentOffering) {
// Display packages: currentOffering.availablePackages
// Each package has: identifier, product.title, product.priceString
}
try {
const { customerInfo } = await Purchases.purchasePackage(selectedPackage);
if (customerInfo.entitlements.active['premium']) {
// User has premium access
}
} catch (e) {
if (!e.userCancelled) {
// Handle error
}
}
const customerInfo = await Purchases.getCustomerInfo();
const isPremium = !!customerInfo.entitlements.active['premium'];
Call this on app launch to gate premium features.
iOS: Use sandbox account in Settings → App Store → Sandbox Account.
Android: Add test email in Google Play Console → License Testing.
Sandbox subscriptions renew every 5 minutes (monthly) or 30 minutes (annual). Makes testing fast.
Forgetting to identify the user. Call Purchases.logIn(userId) after auth so purchases are associated with the account.
Not handling restore. Add a "Restore Purchases" button. Apple requires it. RevenueCat makes it one call: Purchases.restorePurchases().
Testing on simulator. Purchases don't work on simulators. Always test on a real device.
| Approach | Time | Maintenance |
|---|---|---|
| Manual (StoreKit + Play Billing) | 28-50 hours | High |
| RevenueCat | 2-3 hours | Low |
| AI App Factory (pre-configured) | 15 minutes | None |
Everything in this guide is already pre-configured in AI App Factory. 11 AI agents automate the rest.