我想为商店中的 android 和 ios 应用程序生成相同的 URL

Sho*_*war 5 android app-store ios google-play-services

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

小智 5

您应该指定,是否要在您的网站上实现这一目标?如果是,您可以使用 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>
Run Code Online (Sandbox Code Playgroud)

如需更多帮助,请参阅:https : //forum.webflow.com/t/redirect-to-app-store-or-play-store-if-webflow-website-opened-from-an-iphone-or-an-安卓设备/21350/6


小智 0

您只需在服务器端即可完成此操作。没有针对此问题的服务