正好要做这个,记录一下
2。网页如何调用自己的app
http://www.dotblogs.com.tw/yang5664/archive/2012/11/24/85039.aspx
3。在mobile safari中巧妙实现检测应用安装就打开,否则进App Store下载
http://www.iunbug.com/archives/2012/09/18/401.html
<html>
<head>
<title>判斷是否有安裝APP,若無,則詢問是否下載</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="images/css.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
var isiPad = navigator.userAgent.match(/iPad/i) != null;
var isiPhone = navigator.userAgent.match(/iPhone/i) != null;
var isandroid = navigator.userAgent.match(/Android/i) != null;
if(isandroid)
{
window.location.href='https://play.google.com/store/apps/details?id=com.fonestock.android.yourapp';
}
if(isiPad)
{
document.location = 'yourappurls://';
setTimeout( function() {
if( confirm( '您似乎沒有安裝, 這個APP, 進行下載?')) {
document.location = 'http://itunes.apple.com/tw/app/id4179293XX';
}
}, 300);
}
if(isiPhone)
{
document.location = 'yourappurls://';
setTimeout( function() {
if( confirm( '您似乎沒有安裝, 這個APP, 進行下載?')) {
document.location = 'http://itunes.apple.com/tw/app/id4179293XX';
}
}, 300);
}
</script>
</head>
<body>
</body>
</html>