Subscriptions and Affiliate Tracking in React Native
Building a subscription model in React Native requires connecting several pieces: the native app stores for payment processing, a receipt validation service for subscription management, and an affiliate tracking system to credit partners who drive new subscribers. This guide walks through the complete setup.
Architecture Overview
The typical subscription stack for a React Native app with affiliate tracking consists of three layers:
- Payment layer: Apple App Store and Google Play handle the actual payment transactions through their native IAP systems
- Subscription management layer: RevenueCat (or Adapty) validates receipts, manages subscription status, and provides a unified API across platforms
- Affiliate tracking layer: Insert Affiliate connects affiliate link clicks to subscription purchases, attributing revenue to the right affiliate partner
These layers communicate through server-side webhooks and callbacks, meaning the integration work happens both in your React Native code and in your backend configuration.
Setting Up RevenueCat
Start by installing the RevenueCat SDK in your React Native project. RevenueCat provides a React Native package that wraps the native iOS and Android purchase APIs into a single JavaScript interface.
Configure your products in App Store Connect and Google Play Console first — your subscription tiers, pricing, and free trial offers. Then mirror these products in RevenueCat's dashboard as Offerings that your app can display.
In your React Native code, initialise RevenueCat early in the app lifecycle with your API key. Use the Offerings API to fetch available subscription plans and display them in your paywall component. When a user taps subscribe, call the purchase method with the selected package.
RevenueCat handles the receipt validation, subscription lifecycle (renewals, cancellations, grace periods), and provides a server-side source of truth for subscription status.
Integrating Insert Affiliate
Insert Affiliate tracks the journey from affiliate link click to subscription purchase. The integration has two parts: handling incoming affiliate links in your app and connecting purchase events to affiliate attributions.
Handling affiliate links: When a user taps an affiliate link, they are directed to the App Store or Play Store (if the app is not installed) or deep-linked into the app (if it is installed). Install the Insert Affiliate React Native SDK to capture the attribution data when the app opens.
The SDK captures the affiliate identifier from the deep link and stores it locally. This identifier persists through the install flow — even when the user installs from the store and opens the app for the first time.
Connecting purchases: Configure Insert Affiliate to receive webhook notifications from RevenueCat. When a user subscribes, RevenueCat sends an event to Insert Affiliate's server, which matches the purchase to the stored affiliate attribution. The affiliate receives credit for the conversion.
Building the Paywall Component
Your paywall is where conversion happens. Build it as a dedicated React Native screen that displays your subscription offerings fetched from RevenueCat.
Key elements of an effective paywall:
- Clear value proposition above the fold
- Subscription tier options with pricing
- Free trial callout if applicable
- Social proof or review highlights
- Prominent subscribe button
Keep the component focused. Every element should move the user toward subscribing. Avoid cluttering the screen with features that distract from the purchase decision.
Testing the Full Flow
Test the complete user journey in sandbox mode:
- Generate a test affiliate link through Insert Affiliate
- Click the link on a test device
- Install the app (or open it if already installed)
- Complete a sandbox subscription purchase
- Verify the attribution appears in Insert Affiliate's dashboard
- Confirm the affiliate is credited with the correct commission
Test on both iOS and Android. The deep linking behaviour differs between platforms, and each app store has its own sandbox purchase environment.
Handling Edge Cases
Several scenarios need attention:
Deferred deep links: When a user clicks an affiliate link but does not have the app installed, Insert Affiliate's deferred deep linking preserves the attribution through the install process. Test this flow specifically.
Subscription restoration: When a user reinstalls the app or switches devices, RevenueCat restores their subscription. The original affiliate attribution remains intact because it is stored server-side.
Family sharing: If a subscriber shares their subscription through Family Sharing, the additional users are not new conversions and should not generate additional affiliate commissions. RevenueCat's entitlement system handles this distinction.
Going Live
Before launching, verify your webhook connections between RevenueCat and Insert Affiliate are configured for production (not sandbox). Set your commission rates, attribution window, and any promotional terms for your initial affiliate partners.
With the technical integration complete, your focus shifts to recruiting affiliates and optimising your paywall conversion rate — the two levers that determine how much revenue your affiliate channel generates.