我需要发送一条包含单个URL以安装应用程序的消息。用户点击URL后,根据用户的设备,窗口/ Mac/ Google商店将打开。
以下代码可以重定向到Google Play Store、Mac App Store,但不能重定向到Windows商店。
switch (_getOS()) { case "Mac": header("location:https://itunes.apple.com/in/app/one-touch-response/id987064767?mt=8"); break;
case "Android":
header("location:https://play.google.com/store/apps/details?id=com.luckey.onetouch1&hl=en");
break;
default:
header("location:http://windowsphone.com/s?appid=b9d594c5-6b7e-4b25-86cb-068f55a1f7bb");
break;
}