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

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

问题描述

在 Android 设备上,打开指向 Google Play 应用的链接:

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

默认会自动打开 Google Play 应用.

will automatically open the Google Play app by default.

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

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?

很遗憾,我无法将 market://与可以打开 Play 的 Intent 一起使用,我只能控制一个网络链接.

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

好像如果我将链接重定向到 market://url,它可以在设备上使用 Google Play 打开.

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

如果在浏览器中打开链接,尽管浏览器不支持 market://,但它能够以某种方式重定向到 Google Play 的浏览器版本.

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.

推荐答案

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

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. Market Play 应用注册后能够处理此类 URL(您可以注册以处理某些意图,并应用过滤器来进一步定义您的应用将处理的内容).
  2. 应用使用 https://play... URL 启动 Intent
  3. 会向用户显示已注册以处理该意图的所有应用的列表.因此,用户能够启动 Play 应用程序 - 第一次(在手机上)启动 https:play... 意图
  4. 当用户选择哪个应用来实现 Intent 时,如果他们选择浏览器(然后将其设置为默认值)- 浏览器将启动(并且下次不会为用户提供该选项).
  5. 此默认设置可以是:SettingsApplicationsAll - 然后找到 Browser App,选择它,然后选择 Clear Defaults"
  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: "SettingsApplicationsAll - Then find the Browser App, select it, and then select Clear Defaults"

您可以根据市场意图直接调用 Play Market,也可以使用 URL 方式.我个人使用 URL 方式——即使使用它还有一些额外的挑战(比如处理这个特定问题).

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天全站免登陆