Php 创建到google play应用下载的直接链接
我在Google Play上有一个应用程序。 我正在向我的客户发送一条短信来下载应用程序,短信中有一个指向PHP页面的链接,我将用户重定向到他的相关商店(appstore,google play) PHP如下所示:Php 创建到google play应用下载的直接链接,php,android,redirect,mobile,google-play,Php,Android,Redirect,Mobile,Google Play,我在Google Play上有一个应用程序。 我正在向我的客户发送一条短信来下载应用程序,短信中有一个指向PHP页面的链接,我将用户重定向到他的相关商店(appstore,google play) PHP如下所示: $iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod"); $iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone"); $iPad = stripos($_SERVER[
$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);
}
我的谷歌下载网址如下:
$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);
}
我的第一个问题——有没有一种方法可以直接将用户重定向到Google Play,而不用问他如何处理链接。我看到了一些关于市场分层的答案,但它不起作用
第二个问题-这是针对用户使用的移动设备重定向用户的最佳实践吗
非常感谢,Hi也有同样的问题。 试用
market://details?id=XXX
而不是
https://play.google.com/store/apps/details?id=XXX
这将直接为我打开Play Store。否,用户将始终可以选择打开链接的应用程序。