如何使用Play Install referrer Library从playstore获得referrer代码?<



我将使用Referrer Library

我读过很多文章,但是没有一篇告诉你如何创建一个链接

例如,我有代码"KSK23DG"这个链接应该是什么样子,这样我才能在我的应用程序中得到它?
https://play.google.com/store/apps/details?id=<apppid>...
val response: ReferrerDetails = referrerClient.installReferrer
val referrerUrl: String = response.installReferrer
val referrerClickTime: Long = response.referrerClickTimestampSeconds
val appInstallTime: Long = response.installBeginTimestampSeconds
val instantExperienceLaunched: Boolean = response.googlePlayInstantParam

点击这里查看我的答案。

向Google Play Store传递数据

您可以通过referrerURL查询参数传入referer数据:

您的一个链接可能看起来像这样(将com.example.myapp替换为您的实际应用程序ID):

https://play.google.com/store/apps/details?id=com.example.myapp&referrer=someid%3Dsomedata

该URL由以下部分组成:

  • Google Play store中应用程序的商店页面的基础URL:
    • https://play.google.com/store/apps/details?id=
  • 您的应用ID:
    • com.example.myapp
  • referrerURL参数:
    • &referrer=
  • 您可自由选择的键值数据。在这种情况下,someid作为键,somedata作为值(注意,%3D=的HTML URL编码):
    • someid%3Dsomedata

测试为了测试这一点,你需要将你的应用上传到Play Store的内部,alpha, beta或生产轨道。据我所知,这不适用于内部应用程序共享。

最新更新