如何获得Android应用id或名称使用PHP, Jquery或任何API


How to get Android App id or name using PHP, Jquery or any API?

我在移动责任网站工作。我使用自己的应用程序显示我的网站。

如何检查用户打开的网站使用我的应用程序或其他应用程序(如:chrome, firefox)。

假设您可能希望通过ducktyping检测web浏览器来检测用户代理。这可以使用Javascript完成。

更新:

var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
    // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
var isFirefox = typeof InstallTrigger !== 'undefined';   
    // Firefox 1.0+
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
    // At least Safari 3+: "[object HTMLElementConstructor]"
var isChrome = !!window.chrome && !isOpera;              // Chrome 1+
var isIE = /*@cc_on!@*/false || !!document.documentMode;   // At least IE6
var output;
output += 'isFirefox: ' + isFirefox + ''n';
output += 'isChrome: ' + isChrome + ''n';
output += 'isSafari: ' + isSafari + ''n';
output += 'isOpera: ' + isOpera + ''n';
output += 'isIE: ' + isIE + ''n';
console.log(output);

这是Rob W.提供的答案的参考链接。