Android Referrer
复制包含安装步骤和该插件完整 Markdown 指南的配置 prompt。
Google Play Install Referrer
标题为 “Google Play Install Referrer” 的章节在 Android 端, getReferrer() 该插件连接到 Google Play Install Referrer 服务,并返回来自 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 安装应用才能获取真实的安装来源数据。
- 设备上的 Play Store 版本必须支持 Install Referrer 服务。
- 无需 Android 运行时权限。
错误情况
“错误情况”章节当 Play Store 服务不可用、不受支持、在返回结果前断开连接,或返回意外响应时,该插件会 reject。
从 Android Referrer 继续
标题为“从 Android Referrer 继续”的部分如果你正在使用 Android Referrer 要规划原生插件工作,请将其与 使用 @capgo/capacitor-install-referrer 以使用 @capgo/capacitor-install-referrer 中的原生能力, Capgo 插件目录 查看 Capgo 插件目录中的产品工作流, Capgo 提供的 Capacitor 插件 查看由 Capgo 提供的 Capacitor 插件中的实现细节, 添加或更新插件 关于“添加或更新插件”中的实现细节,以及 Ionic Enterprise 插件替代方案 关于“Ionic Enterprise 插件替代方案”中的产品工作流。