Search packages, repositories and app categories

Package detailsv1.2.1

install_referrer

Detect from where your application was installed (Google Play, App Store, TestFlight…)

AndroidiOS
30-day downloads
1.5K
Likes
72
Pub points
140

Install package

flutter pub add install_referrer

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The install_referrer package enables Flutter applications to detect the source from which they were installed, such as Google Play, App Store, or TestFlight. It provides a simple API to retrieve referrer information at app launch, helping developers track marketing campaigns and user acquisition sources. Compatible with both Android and iOS, it leverages native platform capabilities through a plugin interface. The package is useful for analytics, attribution, and campaign tracking in mobile apps.

Use cases

  • Tracking user acquisition sources
  • Analyzing marketing campaign performance
  • Integrating with analytics platforms
  • Attributing installs to specific ads
  • Supporting referral programs

Key features

  • Cross-platform support (Android & iOS)
  • Simple API for referrer retrieval
  • Native integration via platform channels
  • Lightweight and minimal dependencies
  • Secure data handling

Suitable for

  • Marketing analytics teams
  • Mobile app developers
  • Campaign tracking systems
  • Referral and incentive programs
  • Apps requiring install attribution

Considerations

  • Requires proper setup on both platforms
  • Limited to initial install referrer only
  • Dependent on platform-specific implementation
  • May not work in all testing environments
  • Data availability depends on ad network and store policies

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

install_referrer

Pub

A Flutter plugin that allows you to detect how your application was installed.

Supported platforms

  • Android: ✅
  • iOS: ✅

Feel free to open a PR to support new platforms.

Installation

  1. Add install_referrer: ^1.2.1 to your pubspec.yaml file.
  2. Import import 'package:install_referrer/install_referrer.dart';
  3. Get the value by invoking the Future InstallReferrer.referrer

Possibles values

Android
Store Value
Google Play InstallationAppReferrer.androidGooglePlay
Amazon App Store InstallationAppReferrer.androidAmazonAppStore
Huawei App Gallery InstallationAppReferrer.androidHuaweiAppGallery
Oppo App Market InstallationAppReferrer.androidOppoAppMarket
Samsung App Shop InstallationAppReferrer.androidSamsungAppShop
Vivo App Store InstallationAppReferrer.androidVivoAppStore
Xiaomi App Store InstallationAppReferrer.androidXiaomiAppStore
Others InstallationAppReferrer.androidManually

If the application was installed from a third party app (eg: GMail, Google Drive, Chrome…), it will be considered as a manual installation (InstallationAppReferrer.androidManually).

If the application was installed from a store (FDroid, Amazon App Shop…) which was not preinstalled on the device (a "non-system" app), it will also be considered as a manual installation (InstallationAppReferrer.androidManually).

If the Android application is in debug mode, it will be marked as InstallationAppReferrer.androidDebug.

iOS
Store Value
App Store InstallationAppReferrer.iosAppStore
Test Flight InstallationAppReferrer.iosTestFlight

If the iOS application is in debug mode (eg: from the simulator), it will be marked as InstallationAppReferrer.iosDebug.

Package name

You can also get the package name (Android) or app id (iOS), by calling instead InstallReferrer.app

Widgets

If you want to receive the result directly in a Widget, you have two choices: InstallReferrerDetectorListener and InstallReferrerDetectorBuilder :

InstallReferrerDetectorBuilder(
  builder: (BuildContext context, InstallationApp? app) {
    if (app == null) {
      return const CircularProgressIndicator.adaptive();
    } else {
      return Text(
        'Package name:\n${app.packageName ?? 'Unknown'}\n'
        'Referrer:\n${referrerToReadableString(app.referrer)}',
          textAlign: TextAlign.center,
      );
    }
  },
);
InstallReferrerDetectorListener(
  child: YourWidget(),
    onReferrerAvailable: (InstallationApp? app) {
      // TODO
    },
);

Categories

Source repository

Projects using this package

No data available yet.