Skip to main content

Referrals

A referral has two halves. The SDK captures the referral code when the app is installed. Your app tells Flyy when the new user signs up, so the code is mapped to them and the referrer gets credited.

1. Install attribution​

Automatic. On first launch the SDK reads the Play Store install referrer, sends the install event and stores the code. You call nothing.

2. Credit the referrer at signup​

Flyy.setUserWithReferralCode("user-1001")
Flyy.setUserWithReferralCode("user-1001") { /* referral mapped */ }
caution

Call this only for new signups. For returning users use setUser.

Your own referral codes​

If users enter a code by hand, or your own deep links carry one, set it before the signup call:

Flyy.setReferrerCode("FRIEND50")
Flyy.setUserWithReferralCode("user-1001")

Reading referral state​

Flyy.getReferrerCode() // captured code, or null for an organic install

Flyy.getReferrerDetails(this, object : FlyyFetchReferrerDetailsListener {
override fun onSuccess(flyyReferrerDetails: FlyyReferrerDetails) {
// flyyReferrerDetails.referrerName / .extReferrerId
}
override fun onFailure(message: String) { }
})

To show the full refer-and-earn screen, open REFERRALS — see Open screens.