Menu

Expo + RevenueCat: Subscriptions in 5 Steps (and How to Test Them)
📰

Expo + RevenueCat: Subscriptions in 5 Steps (and How to Test Them)

DEV Community: reactnative·Famitha M A·5 days ago
#Jf0hxkcY
#devtoreactnative#devto#dev#purchases#const
Reading 0:00
15s threshold

TL;DR

Real purchases don't work in Expo Go. RevenueCat only runs a mock Preview API Mode there. Use a development build.

Configure the SDK once at startup with a per-platform public key.

Gate features on an entitlement ( pro ), never on product IDs.

purchasePackage throws when the user cancels. Check e.userCancelled and move on.

restorePurchases only from a button tap, never on launch.

Test with RevenueCat's Test Store first, then Apple/Google sandboxes before review.

1. Install and rebuild

npx expo install react-native-purchases react-native-purchases-ui expo-dev-client eas build --profile development --platform all

Enter fullscreen mode

Exit fullscreen mode

Skip the rebuild and you'll get `new NativeEventEmitter()` requires a non-null argument , which RevenueCat's docs call out directly.

2. Configure once

// app/_layout.tsx useEffect (() => { if ( __DEV__ ) Purchases . setLogLevel ( LOG_LEVEL . VERBOSE ); Purchases . configure ({ apiKey : Platform . OS === ' ios ' ? process . env .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.