Skip to main content

Implement Mobile Referrals

Gameball referrals for mobile apps rely on deep links generated by a provider such as Branch or Adjust.
The deep link provider attaches a referral code to the link, and your app extracts it and passes it to Gameball when registering the new customer.
Firebase Dynamic Links are no longer supported for new integrations.
Use Branch or Adjust instead.

Setup Overview

1

Choose a Deep Link Provider

Use Branch or Adjust to generate referral links and handle deep/deferred linking in your iOS app.
2

Install the Provider SDK

Add the provider SDK (Branch or Adjust) via Swift Package Manager following their official documentation.
3

Configure Deep Linking

Configure Universal Links / URL schemes and deferred deep linking according to your provider’s guide.
4

Connect Provider in Gameball

In the Gameball dashboard, go toSettings → Admin Settings → Integration → Mobile Configuration → Dynamic Link Providerand connect your Branch or Adjust configuration.
Gameball will instruct your deep link provider to append a referral identifier
(e.g. ?referrerCode=SARAH123) to each referral link.

Your deep link provider (Branch / Adjust) will call a callback with link parameters whenever:
  • The app is opened from a referral link (cold start), or
  • The app is already running and receives a deep link (warm start).
You only need to:
  1. Extract the referrer code from the provider’s payload
  2. Temporarily store it (e.g. in UserDefaults)
  3. Use it when you call InitializeCustomerRequest

Example: Extract & Store Referrer Code

This example assumes you already integrated Branch/Adjust and are receiving a params or userInfo dictionary from their SDK.
Follow the official Branch / Adjust integration guides for the exact initialization and callback code.Your only Gameball-specific responsibility is extractingreferrerCode and saving it.

SwiftUI Integration (Conceptual Flow)

In SwiftUI, you can still use an AppDelegate adaptor or handle incoming URLs via .onOpenURL, and then forward the resolved parameters to handleDeepLinkParameters.
And inside your Branch / Adjust callback (which might still live in AppDelegate or another handler), forward the parameters:

Register Customer with Referral Code

When the new customer completes registration or first login, include the stored referrer code (if any) in InitializeCustomerRequest.
Always clear the stored referral code after the customer successfully registers, to avoid it being applied again later.

Use the SDK to retrieve a customer’s unique referral code and shareable link.

UIKit


SwiftUI


Referral Flow Summary

1

Referrer Gets a Link

Existing customer retrieves their unique referral link from the app (via getCustomerReferralInfo).
2

Referrer Shares Link

The link is shared through social networks, messaging apps, or email.
3

New User Opens Link

The new customer installs or opens the app via a deep link (Branch/Adjust).
4

App Captures Referrer Code

Your deep link provider passes parameters, and you store the referrerCode temporarily.
5

New User Registers

When the new customer registers, you call initializeCustomer with the stored referralCode.
6

Rewards Are Granted

Gameball rewards the referrer and the referred customer based on your referral program configuration.
Configure referral rules, rewards, and eligibility in your Gameball dashboard.The SDK’s job is to pass the correct referralCode at registration and provide the sharable referral link.