通过浏览器链接打开Play商店应用 [英] Open play store app from browser link

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

问题描述

来自这篇文章能够创建将用户从单个链接重定向到android或ios的功能。但是,在检测到Android时,我想打开显示我的应用程序的Play商店。我尝试了以下有关重定向的链接:

From this post I was able to create a functionality to redirect user to android or ios from a single link. However, on detection of Android I want to open the play store with my app shown. I tried the below link on redirect:

window.location.href = "https://play.google.com/store/apps/details?id=com.myapp";

,但它会在浏览器中打开Play商店。我想打开Play商店应用,我假设我的应用用户将拥有Play商店应用,因此我不想检查Play商店应用是否已安装。我还尝试了以下市场链接

but it opens the play store in the browser itself. I want to open the play store app, I am assuming that my app users will be having the play store app, so I do not want to check whether the play store app is installed or not. I also tried the market link as below

window.location.href = "market://details?id=com.myapp";

,但这也不起作用。

推荐答案

我通过在重定向中使用以下网址来使其正常工作

I got it working by using the below url on redirect

window.location.href = "https://play.app.goo.gl/?link=https://play.google.com/store/apps/details?id=com.myapp";

当我从手机的浏览器访问此网址时,它不会在浏览器中打开Play商店但改为打开Play商店应用。这符合我的目的。

When I visit this url from the browser of my mobile, it does not open the play store within browser but opens the play store app instead. This serves my purpose.

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

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