可能重复:
iPhone Safari: check if URL scheme is supported in javascript?
我正在使用pic2shop为移动网络应用提供条形码扫描。对于iOS,可以检查[canOpenURL]以查看特定方案是否有效(tel://,pic2shop://)。移动浏览器(iOS,Android等)中是否有提供相同功能的东西?
答案 0 :(得分:1)
您可以尝试将该网址放在iframe
中并等待几秒钟。如果您没有被重定向到某个应用程序,则表示它未注册。
setTimeout(function() {
alert('It seems that your device does not support our feature.');
}, 1000);
document.write('<iframe style="border:none; width:1px; height:1px;" src="pic2shop://"></iframe>');