搜索插件、代码仓与 APP 分类

插件详情v1.2.1

install_referrer

检测您的应用程序是从何处安装的(Google Play、App Store、TestFlight 等)

AndroidiOS
近 30 天下载
1450
喜欢数
72
Pub 分数
140

安装插件

flutter pub add install_referrer

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

install_referrer 包使 Flutter 应用能够检测其安装来源,例如 Google Play、App Store 或 TestFlight。它提供了一个简单的 API,在应用启动时检索引荐信息,帮助开发者追踪营销活动和用户获取来源。该包兼容 Android 和 iOS,通过插件接口利用原生平台功能。该包在移动应用的分析、归因和活动跟踪方面非常有用。

适合场景

  • 跟踪用户获取来源
  • 分析营销活动表现
  • 与分析平台集成
  • 将安装归因于特定广告
  • 支持推荐计划

主要特点

  • 跨平台支持(Android 和 iOS)
  • 用于获取引荐来源的简单 API
  • 通过平台通道实现原生集成
  • 轻量且依赖极少
  • 安全的数据处理

适合对象

  • 营销分析团队
  • 移动应用开发人员
  • 活动跟踪系统
  • 推荐和激励计划
  • 需要安装归因的应用程序

使用建议

  • 两个平台都需要正确设置
  • 仅限初始安装推荐人
  • 依赖于平台特定的实现
  • 在所有测试环境中可能无法正常工作
  • 数据可用性取决于广告网络和商店政策

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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
    },
);

所属分类

源码仓库

使用此插件的项目

暂无相关数据。