谷歌Android游戏推荐人的意图 [英] Android Google Play intent referrer

查看:139
本文介绍了谷歌Android游戏推荐人的意图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在谷歌推出游戏是这样的:

 意向意图=新意图(Intent.ACTION_VIEW,Uri.parse(市场://细节ID = com。示例));
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(意向);

我想引用包括数据,如下解释:<一href=\"https://developers.google.com/analytics/devguides/collection/android/devguide#google-play-builder\" rel=\"nofollow\">https://developers.google.com/analytics/devguides/collection/android/devguide#google-play-builder
Unfortunetely它产生从而导致了谷歌Play网站的URL。什么是等价的意图是什么?我很感谢一个示例源$ C ​​$ C。

感谢。


解决方案

添加引用数据,谷歌播放链接的工作原理相同的应用程序内的链接,它为Web:

您可以在您的市场URI,即通过引用参数添加引用数据:

<$p$p><$c$c>market://details?id=com.example&referrer=utm_source%3Dmyapp%26utm_medium%3Dcross-sell

如果用户选择再安装应用程序到您联系,谷歌Play应用程序会传递引用参数的值,如果present,如期间在 com.android.vending.INSTALL_REFERRER 意图额外的字符串进行安装。

请注意,引用数据不通过从谷歌Play商店的网站发起的远程安装。

I'm launching Google Play like this:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.example"));                                                           
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(intent);

I'd like to include referrer data, as explained here: https://developers.google.com/analytics/devguides/collection/android/devguide#google-play-builder Unfortunetely it generates the url which leads to the google play website. What's the equivalent for the intent? I'd be thankful for a sample source code.

Thanks.

解决方案

Adding referrer data to Google Play links works the same for in-app links as it does for the web:

You can add referrer data via a referrer parameter in your market URI, i.e.:

market://details?id=com.example&referrer=utm_source%3Dmyapp%26utm_medium%3Dcross-sell

If the user chooses to then install the app to which you linked, the Google Play app should pass the value of that referrer parameter, if present, as a string extra in the com.android.vending.INSTALL_REFERRER intent during the install.

Note that referrer data is not passed for remote installs initiated from the Google Play Store website.

这篇关于谷歌Android游戏推荐人的意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆