此篇需要幾個連結
------------------------------------------------------
https://github.com/jasny/jquery.smartbannerPromoting Apps with Smart App Banners
------------------------------------------------------
這次這個真的搞死我了,
為了增加這個功能跑去查東查西,得到的資訊很少
smart banner 是從ios6之後就有的功能
在取得BANNER前需要先得到該APP的ID
取得GOOGLE PLAY ID
GOOGLE PLAY比較簡單
透過 GOOGLE PLAY網頁版找尋APP後
好比找到COC的連結如下
play.google.com/store/apps/details?id=com.supercell.clashofclans
ID就是 com.supercell.clashofclans
取得itunes ID
點擊上面提供的 link maker
找尋到自己的APP,注意國家跟類型要更動會更好找
一樣用COC當範例
linkmaker.itunes.apple.com/en-us/details/529479190
就可以得到該APP的 ID是 529479190
<html>
<head>
<title>YouTube</title>
<meta name="author" content="Google, Inc.">
<meta name="apple-itunes-app" content="app-id=544007664">
<meta name="google-play-app" content="app-id=com.google.android.youtube">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="jquery.smartbanner.css" type="text/css" media="screen">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
</head>
<body>
...
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script src="jquery.smartbanner.js"></script>
<script type="text/javascript">
$(function() { $.smartbanner() } )
</script>
</body>
</html>
照此JS的作者提供的範例去更動上面的APP ID就可以連到自己的APP
只需要切換meta tag就可以哩
之後利用 $.smartbanner() 就可以呼叫
這邊要注意的是用iphone 開chrome 似乎會被判定為android?
這邊我是利用force去做判斷 避免出錯
如果有用背景圖之類的就要注意laywer的問題啦~~~