Photo by Omid Ajorlo on Unsplash

Implementing ‘Invite a Friend’ in Flutter: Overcoming iOS Challenges

Djordje Madic

--

Referral programs are a cornerstone of mobile app growth strategies, leveraging the power of word-of-mouth to convert satisfied users into advocates.

On Android, the Google Play Install Referrer API makes it easy to track the source of app installs and attribute them to the correct referrer. However, iOS presents a different scenario — without native support for automatic invite detection, creating a seamless referral experience becomes far more complex.

In this article, we’ll explore three different approaches to implementing an “Invite a Friend” feature in a cross-platform Flutter app, focusing on the unique challenges and solutions for iOS.

Options

Option 1: Third-Party Tool — Branch.io

One of the most frequently suggested third-party tools for solving this problem is Branch.io. It offers much more than just referral program capabilities; it provides comprehensive solutions for deep linking, attribution tracking, and cross-platform user experiences.

How it Works

Branch.io handles iOS referral tracking by using device fingerprinting. When Alice sends an invite link to Bob, who does not have the app installed, Bob is first navigated to Branch.io’s backend system.

The system captures Bob’s device fingerprint and then redirects him to the App Store. Once Bob installs the app, the app generates the same device fingerprint, which allows Branch.io to match the installation to Bob’s original click on Alice’s referral link.

This process enables Branch.io to accurately track the referral and reward both Alice and Bob.

Using device fingerprinting to track referrals

Pros:

  • Proven, off-the-shelf solution
  • Referral analytics included
  • Free for up to 10,000 users; scalable pricing beyond that

Cons:

  • Another external tool to integrate and learn
  • May require time to understand and implement
  • The tool has more features than you may need, which can complicate GDPR compliance

For more details on integrating Branch.io, you can read this guide.

Option 2: Build It Yourself

Another approach is to build a custom system that mimics Branch.io’s device fingerprinting mechanism.

How it Works: You would create a backend that captures device fingerprints when users click on referral links, stores this data, and then matches it when the app is installed and opened on the referred device.

Pros:

  • Full control over the system’s behavior
  • The system does exactly what you need and nothing more

Cons:

  • High effort, particularly if you’re unfamiliar with device fingerprinting
  • Requires backend development for tracking and rewarding referrals
  • Maintenance cost: Device fingerprinting relies on data that might change over time, requiring ongoing updates
  • Requires building or integrating an analytics system to track referral usage

Option 3: Referral Codes

The third option is to ask new users to enter a referral code during the onboarding process if they were invited to the app.

How it Works: When Bob installs the app, he’s prompted to enter a referral code provided by Alice. If Bob enters the code, both users can be rewarded.

Pros:

  • Straightforward to implement compared to building a custom fingerprinting system
  • Easier to estimate the effort required

Cons:

  • Relies on users remembering and entering the referral code
  • Requires backend development for tracking and rewarding referrals
  • Requires building or integrating an analytics system to track referral usage

Conclusion

For mobile developers and architects, implementing a seamless “Invite a Friend” feature in a cross-platform app requires careful consideration of the challenges posed by iOS. Whether you opt for a third-party tool like Branch.io, build a custom solution, or use a more straightforward referral code system, each approach has its trade-offs in terms of complexity, cost, and user experience.

As you plan your implementation, weigh these options against your team’s expertise and resources. Understanding the nuances of each solution will help you choose the right approach, ensuring that your referral program is both effective and sustainable.

Let’s connect on LinkedIn!

I’d love to hear your thoughts and continue the conversation.

https://www.linkedin.com/in/djordjemadic

--

--