A complete guide on integrating and managing in-app purchases and subscriptions using RevenueCat in a React Native application. Includes real usage code, listener handling, and a real-world bug fix example.
React Native In-App Purchases with RevenueCat
This guide outlines how to integrate and manage in-app subscriptions in a React Native application using RevenueCat’s react-native-purchases SDK, with real-world code, usage, and debugging insights.
Real Trouble Example: Subscription Flag Always True
Symptom
After calling restorePurchases(), customerInfo.entitlements.active['your_entitlement_identifier'] always returns a non-undefined value — even when the user didn’t subscribe.
Cause
In real-world scenarios (especially on iOS), when a user cancels a subscription, they still retain access to the content until the end of the current billing period. This means RevenueCat will still report the entitlement as active until the subscription period officially ends. As a result, during a restore operation, the isSubscribed flag may appear true even though the user has already canceled the subscription. This is expected behavior in accordance with App Store billing policies.