如果安装了应用,请启动应用,或者使用安装引荐来源打开Goog​​le Play [英] Launch app if installed, or open Google Play with install referrer

查看:185
本文介绍了如果安装了应用,请启动应用,或者使用安装引荐来源打开Goog​​le Play的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正尝试生成一个链接,在浏览器中单击该链接时,如果已安装它,则会打开我们的应用程序。
这通常是这样做的:

We are trying to generate a link that, when clicked in a browser, opens our App if it's installed. This is usually done with something like this:

intent://some.domain/some=parameters#Intent;scheme=somescheme;package=my.package.name

如果配置正确,这个uri可以启动你的应用程序是否已安装,否则将您重定向到Play商店。但是,这不是我们想要的。我们希望通过安装推荐链接将其重定向到Play商店。据我们所知, intent:// 语法不能做到这一点。

If configured correctly, this uri can launch your App if it's installed, and redirect you to the play store otherwise. However, this is not what we want. We want to redirect to the play store with an install referrer. As far as we know, the intent:// syntax cannot do this.

我们提出的另一个解决方案是制作

Another solution we came up with was to make

market://details?id=my.package.name&referrer=somereferrer

可以通过我们的应用程序打开。这种方法的问题是它不会自动启动应用程序,而是询问用户他们是否想要打开与我们的应用程序或Play商店的链接。

openable with our App. The problem with this method is that it will not automatically launch the App, but rather ask the user whether they'd like to open the link with our App or the Play Store.

对此的任何解决方法?即使是最细微的建议,我们将不胜感激。

Any workaround for this? Even the slightest suggestion would be appreciated.

推荐答案

我认为这是您的答案 https://stackoverflow.com/a/28792160/5034920
基本上你必须像这样实现意图过滤器:

I think this is your answer https://stackoverflow.com/a/28792160/5034920 Basically you must implement the intent filter like this:

<data android:scheme="https"
      android:host="www.foo.com"
      android:pathPrefix="/bar" />

,并在服务器端创建一个重定向规则以便Google Play。例如, https://www.foo.com/bar/BlahBlah 将重定向到< a href =https://play.google.com/store/apps/details?id=com.bar.foo&referrer=BlahBlah =nofollow noreferrer> https://play.google.com/store /apps/details?id=com.bar.foo&referrer=BlahBlah 。

and at the server side, create a redirect rule to google play. For example, https://www.foo.com/bar/BlahBlah will redirect to https://play.google.com/store/apps/details?id=com.bar.foo&referrer=BlahBlah.

这篇关于如果安装了应用,请启动应用,或者使用安装引荐来源打开Goog​​le Play的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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