通过重定向链接在Google Play中打开应用 [英] Opening app in Google Play from a redirect link

查看:731
本文介绍了通过重定向链接在Google Play中打开应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android设备上打开Goog​​le Play应用的链接:

https://play.google.com/store/apps/details?id=com.rovio.angrybirds&hl=zh-CN

默认情况下会自动打开Goog​​le Play应用程序。



但是,如果您有链接重定向到Google Play链接,设备将打开浏览器,然后导航到Google Play的浏览器版本。为什么会出现这种行为?



不幸的是,我无法使用market://可以打开Play的Intents,我只能控制网页链接。



编辑:
似乎如果我将链接重定向到market:// url,它可以通过设备上的Google Play打开。 / p>

如果链接在浏览器中打开,不管怎样,它都可以重定向到Google Play的浏览器版本,尽管market://在浏览器中不受支持。

解决方案

基本上, https:// play .. ..只是一个网址。我怀疑它的工作方式(这是Android工作的标准方式)是:


  1. Market Play应用程序注册为可以处理这种URL(您可以注册以处理某些意图,并应用过滤器来进一步定义您的应用程序将处理的内容)。

  2. 该应用程序通过 https:// play 启动Intent ... URL
  3. li>
  4. 用户会看到所有注册的应用程序列表,以处理该意图。因此,用户可以启动Play App - 第一次(在电话中)https:\play ...意图启动

  5. 当用户选择哪个应用程序如果他们选择浏览器(然后将其设置为默认设置),浏览器将启动(并且下次不会为用户提供该选项)。 这个默认设置可以是通过:Settings \Applications\All-然后找到浏览器应用程序,选择它,然后选择Clear Defaults

您可以直接通过市场意向呼叫Play Market,或者使用URL方式。我个人使用URL方式 - 尽管使用它还有一些额外的挑战(如处理这个特定问题)。


On an Android device, opening a link to an app on Google Play:

https://play.google.com/store/apps/details?id=com.rovio.angrybirds&hl=en

will automatically open the Google Play app by default.

But if you have a link that redirects to the Google Play link, the device opens the browser and then navigates to the browser version of Google Play. Why does this behavior occur?

Unfortunately I cannot use the market:// with Intents which can open Play, I have only control over a web link.

edit: Seems like if I have the link redirect to the market:// url, it can open with Google Play on device.

If link is opened in browser, somehow it is able to redirect to browser version of Google Play despite market:// not being supported in browser.

解决方案

Basically, the https://play.... is just a web URL. I suspect the way this works (which is the way standard way Android works) is:

  1. The Market Play App registers to be able to handle URLs of this kind (you can register to handle certain intents, and apply filters to further define what your app will handle).
  2. The app launches the Intent with the https://play... URL
  3. The User is presented with a list of all apps that are registered to handle that intent. SO, the User is able to launch the Play App - the first time (on the phone) the https:\play... intent is launched
  4. When the user chooses which app to fulfill the Intent, if they select Browser (then set it as a default) - the Browser will launch (and will not offer the user the option the next time).
  5. This default can be by: "Settings\Applications\All - Then find the Browser App, select it, and then select Clear Defaults"

You can either call the Play Market directly with the market intent, or use the URL way. I personally use the URL way - even though there are some additional challenges to use it (like handling this particular issue).

这篇关于通过重定向链接在Google Play中打开应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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