How Kalo Uses Flinku for Referral Deep Linking on iOS
Kalo is an AI-powered calorie tracking app for iOS. Users log meals by snapping a photo, speaking, or typing. The app includes a calorie ring dashboard, water tracking, a fasting tracker with Live Activities, a social accountability feature called Track, and an AI coach. It is available on the App Store at drkalo.app.
This post covers how Kalo uses Flinku to handle referral deep linking, including the deferred case where a new user installs the app after tapping a referral link.
The Problem: Referral Context Gets Lost at the App Store
Kalo has a referral program. When an influencer or existing user shares a referral link, the goal is simple: the person who taps that link should be recognized as a referral and the referrer should get credit.
The problem is the App Store. When a new user taps a referral link and does not have the app installed, they get redirected to the App Store. After installing and opening the app, the original link context is gone. The app has no way to know who referred them or what the original link contained.
This is the deferred deep linking problem. The link destination needs to survive the App Store install and be recovered when the app opens for the first time.
How Flinku Solves It
Generating the referral link
Each referral link carries a ref parameter identifying the referrer:
go.drkalo.app?ref=sarah
This link is generated using createLinkInstant inside the Kalo app. The short URL is created on-device with no network wait. The user taps share and the link is ready immediately with no spinner.
Fingerprinting the user before install
When a new user taps the referral link, Flinku's server records a fingerprint of that device. This fingerprint is a combination of IP address and a hash of the user agent string. It is stored alongside the referral parameters from the original link.
The user is redirected to the App Store. They install Kalo and open it for the first time.
Recovering the referral after install
On first launch, the Kalo app calls Flinku.match(). Flinku compares the device fingerprint at launch against stored pending fingerprints. When a match is found, the original link parameters including the ref code are returned to the app.
Flinku.configure(baseUrl: "https://go.drkalo.app")
Flinku.match { link in
guard let link = link else { return }
AppState.shared.pendingDeepLink = link
}
The deep link parameters are stored on launch and held until the user completes sign in or onboarding. This timing matters: the referral context is available immediately on launch but only consumed after auth is complete, so it does not get lost during the sign in flow.
Crediting the referral
Once the user completes sign in, the pending deep link is consumed:
if let pending = AppState.shared.pendingDeepLink {
if let ref = pending.params["ref"] {
// Credit the referral via your backend
}
AppState.shared.pendingDeepLink = nil
}
The referral is recorded and rewards are applied to the referrer's account.
The Custom Domain
Kalo uses a custom domain through Flinku: go.drkalo.app. All referral links use this domain instead of the default Flinku subdomain. This is available on the Studio plan and requires adding a CNAME record pointing to flku.dev and verifying it through the Flinku dashboard.
Every referral link looks like a native Kalo link with no trace of a third-party service.
The Full Flow
An influencer shares go.drkalo.app?ref=sarah in a post. A follower taps the link. They do not have Kalo installed. Flinku records their device fingerprint and redirects them to the App Store. They install Kalo and open it for the first time. Flinku.match() runs on launch and recovers the ref=sarah parameter. After the user completes sign in, the referral is credited and the user is navigated to the right screen.
No code entry. No extra steps. The referral context survives the entire App Store install flow automatically.
Why This Matters for Referral Programs
Referral programs without deferred deep linking only work when the app is already installed. Any new user who comes through the App Store loses the referral context. The referrer does not get credit, the new user does not get their referral benefit, and the incentive to share breaks down.
Deferred deep linking fixes this. The referral context survives the install and is recovered automatically on first launch. Referrers get credit for every install they drive, not just opens from users who already have the app.
Getting Started
Flinku is available at flinku.dev. The iOS SDK is on GitHub. The free plan includes deferred deep linking with no credit card required.
Full SDK documentation is at docs.flinku.dev.