Promo codes that survive the install
The code was in the share. The user installed. The code is gone. Carry it through the install gap and apply it automatically.
Promo codes are one of the highest-intent links you have. Someone shares 'use SUMMER50,' a friend taps, installs, opens — and stares at a homepage with no code, no memory, and a manual-entry field they'll never use. The most motivated install you'll get all week, fumbled at the last step.
Where redemption breaks
The code lives in the link. The install gap strips it. Unless you carry the code in a deferred payload, the user has to remember it, retype it, and not make a typo — three places to lose them.
Carry it in the payload
Put the code and its constraints in the deferred deep link so the app receives them on first open.
{
"deepLinkPath": "/checkout",
"customData": {
"code": "SUMMER50",
"expiresAt": "2026-09-01",
"referrer": "alex-rivera"
}
}Apply it automatically
On first open, validate and apply the code before the user has to think about it. The first thing they see should be the discounted price, not an empty promo field.
LinkTrail.shared?.onLink { link, source in
guard let code = link.customData["code"], promos.isValid(code) else { return }
cart.apply(code)
router.navigate(to: link.path)
}Guardrails
- Honor expiry server-side — never trust the payload's date alone.
- Bind referral codes to the referrer so you can credit them and catch self-referral abuse.
- Rate-limit redemptions per device to keep a leaked code from becoming a budget hole.