我将使用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传递数据
您可以通过referrer
URL查询参数传入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
referrer
URL参数:&referrer=
- 您可自由选择的键值数据。在这种情况下,
someid
作为键,somedata
作为值(注意,%3D
是=
的HTML URL编码):someid%3Dsomedata
测试为了测试这一点,你需要将你的应用上传到Play Store的内部,alpha, beta或生产轨道。据我所知,这不适用于内部应用程序共享。