install_referrer 1.2.1 icon indicating copy to clipboard operation
install_referrer: ^1.2.1 copied to clipboard

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

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 #

StoreValue
Google PlayInstallationAppReferrer.androidGooglePlay
Amazon App StoreInstallationAppReferrer.androidAmazonAppStore
Huawei App GalleryInstallationAppReferrer.androidHuaweiAppGallery
Oppo App MarketInstallationAppReferrer.androidOppoAppMarket
Samsung App ShopInstallationAppReferrer.androidSamsungAppShop
Vivo App StoreInstallationAppReferrer.androidVivoAppStore
Xiaomi App StoreInstallationAppReferrer.androidXiaomiAppStore
OthersInstallationAppReferrer.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 #

StoreValue
App StoreInstallationAppReferrer.iosAppStore
Test FlightInstallationAppReferrer.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
    },
);
23
likes
130
pub points
70%
popularity

Publisher

verified publisher icondaad.mobi

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

Icon for licenses.Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on install_referrer