跳过内容

安卓来源器

GitHub

在 Android 上, getReferrer() 连接到 Google Play 安装引荐者服务并从 Play Store 安装记录中返回数据。

const result = await InstallReferrer.getReferrer();
console.log(result.referrer);
console.log(result.clickTimestampSeconds);
console.log(result.installBeginTimestampSeconds);
console.log(result.googlePlayInstantParam);

返回的字段

返回的字段
字段描述
platform始终 android.
referrer原始Play安装引荐字符串。
clickTimestampSeconds客户端引荐点击时间戳(秒)。
installBeginTimestampSeconds客户端安装开始时间戳(秒)。
googlePlayInstantParam用户是否启动了应用的即时体验。

需求

需求
  • 应用必须从Google Play安装才能获取真实的安装引荐数据。
  • 设备必须具有支持Install Referrer服务的Play Store版本。
  • 无需 Android 运行时权限。

错误案例

错误案例

当Play Store服务不可用、不支持、断开连接前返回结果或返回的响应不期望时,插件会拒绝。

继续使用Android Referrer

继续使用Android Referrer

如果您正在使用 安卓来源器 来规划原生插件工作,连接它到 使用@capgo/capacitor-install-referrer 为原生能力在使用@capgo/capacitor-install-referrer中 Capgo插件目录 为 Capgo 产品工作流程在 Capgo 插件目录中 Capacitor 插件由 Capgo 提供 为 Capacitor 插件的实现细节在 Capacitor 插件由 Capgo 提供中 添加或更新插件 为添加或更新插件的实现细节,并且 Ionic 企业插件替代品 为 Ionic 企业插件替代品的产品工作流程在中