简体   繁体   English

建立直接连结至Google Play应用程式下载

[英]Create a direct link to google play app download

I have an app on Google Play. 我在Google Play上有一个应用。 I am sending a SMS message to my clients to download the application, there is a link in the SMS to a PHP page where I redirect the user to his relevant store (appstore, google play). 我正在向客户发送一条SMS消息以下载该应用程序,SMS中有一个指向PHP页面的链接,我将用户重定向到他的相关商店(appstore,google play)。

The PHP looks like the following: PHP如下所示:

$iPod    = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone  = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad    = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");

if( $iPod || $iPhone || $iPad){
  header('Location: ' . APPLE_DOWNLOAD_URL);
}else if($Android){
  header('Location: ' . GOOGLE_DOWNLOAD_URL);
}else {
  header('Location: ' . WEB_DOWNLOAD_URL);
}

My Google_DOWNLOAD_URL is the following: 我的Google_DOWNLOAD_URL是以下内容:

https://play.google.com/store/apps/details?id=XXX https://play.google.com/store/apps/details?id=XXX

My first question - is there a way to redirect the user directly to the Google Play, without asking him what to do with the link. 我的第一个问题-有没有一种方法可以将用户直接重定向到Google Play,而无需问他如何处理链接。 I saw some answers about strating with market:// but it's not working. 我看到了一些关于使用market://的答案,但是它没有用。

Second question - is this the best practice to redirect users regarding the mobile device they use? 第二个问题-这是重定向用户有关他们使用的移动设备的最佳实践吗?

Thanks a lot, 非常感谢,

Hi was having the same problem. 嗨,我遇到了同样的问题。 Try using 尝试使用

market://details?id=XXX

instead of 代替

https://play.google.com/store/apps/details?id=XXX

This opens up the Play Store directly for me. 这将直接为我打开Play商店。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM