Blog
Tutorial
March 17, 20268 min

How I Built a Complete Referral System in React Native in One Day

Yesterday, I spent 8 hours coding something completely unrelated to the product itself. No new feature. No bug fix. No optimization. A referral system.

I'm developing TAMSIV, a voice-powered task manager for Android. Solo dev, 660+ commits, 6 months of work. I have 12 alpha testers on the Play Store and I need that number to grow — organically.

The concept

Simple: each user has a unique referral code. You share it. When someone signs up with it, both get 1 month of free Pro. And it stacks — 10 referrals = 10 free months, queued one after another.

The 3 capture sources

The hardest part isn't generating the codes. It's capturing them reliably.

1. Deep links via the website

When someone visits tamsiv.com/invite/CODE, Next.js redirects to the Play Store with the referral code embedded.

2. Android App Links (direct opening)

If the app is already installed, tamsiv://invite/CODE opens it directly. This requires configuring AndroidManifest.xml with the appropriate intent-filters and an assetlinks.json file on the website for verification.

3. Play Store Install Referrer

This is the most underestimated source. When someone clicks a Play Store link with a &referrer=CODE parameter, Android stores this string. Even if the person installs the app 3 days later, we can still read the code.

Stacked rewards

Most referral systems give a single reward. I wanted rewards to accumulate. Each referral adds 30 days of Pro, queued after the previous one expires.

Push notifications in 6 languages

When someone uses your code, you receive a push notification. In your language. Because TAMSIV speaks 6 languages, the backend checks the referrer's language preference before sending via FCM.

In numbers

  • 22 files modified (backend, frontend, website, Android manifest)
  • 1,324 lines added
  • 1 day of focused work
  • 6 languages supported
  • 3 capture sources for maximum coverage

What I learned

Android App Links verification is fragile. The assetlinks.json file must be served at the exact right location with the exact SHA256 of your signing key.

The Play Store Install Referrer is underestimated. Most tutorials skip it, but it's the only way to capture referrals via delayed installs.

Stacking rewards adds complexity. A simple "give 1 free month" is easy. Queuing multiple rewards requires managing start dates, end dates, and the relationship with RevenueCat.