Referral links for mobile apps: how invite links work, and how to credit the right person
An invite link has to remember who shared it through a tap, a store visit and an install. How app referral links work on iOS and Android, what a referral SDK does, how to avoid crediting the wrong person, and how to build one.
· DL2App · 4 min read
A referral programme sounds simple: each user gets a link, friends who install through it are credited, and the referrer gets a reward. The hard part is the middle. Between the tap and the friend's first open, the friend goes to the App Store or Google Play, installs, and opens a fresh app that knows nothing about the link.
This post explains how referral links carry the referrer through that gap, what a referral SDK does, and how to credit the right person.
The short answer
- A referral link carries an id for the person who shared it, such as
?ref=user_8812. - It has to survive the install. That's deferred deep linking: exact on Android through the Play Install Referrer, matched or handed over by clipboard on iOS.
- The app reads the referrer on first launch and tells your backend, which decides the reward.
- Prefer exact matches for rewards, and keep an invite-code field as a fallback.
How an invite link works
- A user taps Invite friends. The app makes a link with their id, for example
https://go.yourapp.com/invite?ref=user_8812, or a short personal link that stores the id. - The friend taps it. The link server records the tap and who it credits.
- If the friend has the app, the link opens it directly (Universal Links or App Links), and the app reads the referrer.
- If not, the friend goes to the store, installs and opens the app. On first launch, the app asks the link service which tap led to this install, and gets the referrer back.
- The app tells your backend: "new user, invited by user_8812." Your backend checks it and gives the reward.
Step 4 is the one that breaks without a service. Universal Links and App Links don't survive an install, so a plain link loses the referrer. More on deferred deep linking.
Android vs iOS
Android is exact. The Google Play link can carry a referrer value, which the app reads on first launch with the Install Referrer API. Every install from Google Play can be credited correctly. How it works.
iOS is harder. The App Store passes nothing through an install, so a service either matches the first launch to a recent tap (an estimate) or hands over a token through the clipboard (exact, with one tap from the user). The iOS options in detail.
For rewards, that difference matters. A wrong guess on iOS could credit the wrong person.
What a referral SDK does
A referral or deep linking SDK in your app usually:
- creates personal invite links with the user's id, from inside the app;
- reads the referrer when the app opens from a link, including the first open after an install;
- tells you how the install was matched (exactly, or estimated);
- reports events such as sign-up or purchase against the referrer, so you can reward on a real action rather than an install.
The reward itself (credit, discount, free month) and your fraud rules belong in your own backend. A link service should credit; your backend should decide.
Crediting the right person
Referral programmes attract gaming. A few rules keep them fair:
- Reward on an action, not an install. A completed sign-up, a first order or a verified phone number is much harder to fake.
- Prefer exact matches. On Android, the Play referrer can't be wrong. On iOS, treat estimated matches as provisional, or confirm them with a code.
- Block self-referrals: the same device, payment method or account details as the referrer.
- Offer an invite-code field in sign-up. It catches installs the link missed, such as when someone installed on a different device.
- Be able to pause a referrer whose installs look suspicious, without breaking the links already shared.
Moving from Firebase Dynamic Links
Many apps built invite links on Firebase Dynamic Links, which shut down in August 2025. If yours did, existing page.link invites may no longer credit anyone. How to move referral links off Firebase.
How DL2App handles referrals
Any DL2App link can credit someone: add ?dl2_ref= with the person's id, or create a personal invite link from the app with the React Native SDK:
const invite = await DL2.createLink({ path: "/invite", referrer: currentUser.id });
share(invite.url);
On first launch, the app's link listener receives the referrer along with whether it's a new install:
DL2.onLink((link) => {
if (link.isFirstOpen && link.referrer) {
api.recordInvite({ invitedBy: link.referrer }); // your own backend
}
});
The Referrals page shows each person's clicks, new installs, events and revenue, and each install is labelled exact or estimated. You can pause crediting for a person without breaking their links. Rewards and fraud rules stay in your backend. Referral links are included on every plan, including Free. See the referral docs and pricing.
The React Native SDK (including Expo) and the web SDK are available now; native iOS, Android and Flutter SDKs are built and in final testing.
Questions people ask
What is a referral SDK? A library in your app that creates invite links with the user's id and reads the referrer when a new user opens the app, including after an install from the store.
How do apps know who referred a new user? The invite link carries the referrer's id. If the friend already has the app, it opens with the link. If not, a deferred deep linking service passes the id through the install: exactly on Android, by matching or clipboard on iOS.
Can I build app referrals without an SDK? Partly. Invite codes typed at sign-up need no SDK. Links that credit automatically after an install need something in the app that asks which link led to it.
How do I stop referral fraud? Reward completed actions rather than installs, prefer exact matches, block self-referrals, and review referrers with unusual install patterns.
Start with one link
The free plan has no time limit and needs no card. Create a project, add your app, and send yourself the link.