Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。












想改善这个问题吗?更新问题,以便将其作为on-topic用于堆栈溢出。

2年前关闭。



Improve this question




我的应用程序商店和Play商店中有应用程序,Android和ios版本
我想生成一个链接,如果它在iPhone中打开,则将用户重定向到应用商店,如果在Android手机中打开,则重定向到播放商店
有没有办法做到这一点,有一些公司正在这样做。

最佳答案

您应该指定是否要在您的网站上实现?
如果是,则可以设置JQuery来检测设备类型,并可以根据设备类型将用户重定向到所需的URL(播放商店或应用商店)

<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>

<script>
        $(document).ready(function (){
         if(navigator.userAgent.toLowerCase().indexOf("android") > -1){
             window.location.href = 'https://play.google.com/store/apps/developer?id=WhatsApp+Inc.&hl=en';
         }
         if(navigator.userAgent.toLowerCase().indexOf("iphone") > -1){
             window.location.href = 'https://itunes.apple.com/in/app/whatsapp-messenger/id310633997?mt=8';
         }
        });
</script>

有关更多帮助,请参考:https://forum.webflow.com/t/redirect-to-app-store-or-play-store-if-webflow-website-opened-from-an-iphone-or-an-android-device/21350/6

10-08 08:03