【问题标题】:open google play store link of App if a user wants to open website in android phone [closed]如果用户想在android手机中打开网站,请打开应用程序的google play store链接[关闭]
【发布时间】:2014-07-04 11:53:03
【问题描述】:

我也有一个网站和一个 Android 应用程序。如果他们在 Android 手机浏览器中打开网站,我希望我的用户被重定向到我的应用程序的 Play 商店链接。实现这一目标的最佳方法是什么?

【问题讨论】:

    标签: javascript php android google-play


    【解决方案1】:

    你不需要做任何特别的事情。当您从 Android 手机上的任何浏览器单击指向 Play 商店的链接时,电子市场应用程序将自动处理该链接。

    例如,尝试在您的 Android 设备上点击此链接:

    http://play.google.com/store/apps/details?id=com.google.android.apps.maps

    如果安装了 Market 应用,会自动打开页面安装应用。

    有很多资源可用于检测 Android 用户代理和重定向。例如http://davidwalsh.name/detect-android

    var ua = navigator.userAgent.toLowerCase();
    var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
    if(isAndroid) {
        // Do something!
        // Redirect to Android-site?
        window.location = 'http://play.google.com/store/apps/details?id=com.google.android.apps.maps';
    }
    

    【讨论】:

    • 如果浏览器是 android 的,我需要这样做来加载网站。它应该自动重定向。我需要申请支票。
    • 查看更新的答案。快速谷歌搜索“重定向移动用户”会出现很多选项。
    猜你喜欢
    • 2012-06-10
    • 1970-01-01
    • 2016-10-10
    • 2014-05-16
    • 2017-08-27
    • 1970-01-01
    • 2018-10-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多