看說明分為直接喚醒和點擊喚醒。 <html xmlns=http://www.w3.org/1999/xhtml> <head> <meta http-equiv=Content-Type content="text/html;charset=utf-8"> <head> <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script> <title>點擊喚醒demo</title> </head> <body> <style> #zjmobliestart{font-size:40px;} </style> <!-- 說明:通過h5可換醒app,如訪問一個URL,點擊按鈕,打開應用,如果該應用APP沒有安裝,那么直接跳轉到App Store的APP下載頁面,通過點擊的方式兼容性較好,如果安裝了app,在手機各大瀏覽器(360瀏覽器 uc瀏覽器 搜狗瀏覽器 QQ瀏覽器 百度瀏覽器 )和QQ客戶端中,能喚醒。微信 新浪微博客戶端 騰訊微博客戶端無法喚醒。 --> <a href="zjmobile://platformapi/startapp" id="zjmobliestart" target="_blank">喚醒浙江移動手機營業廳!</a> <script type="text/javascript"> function applink(){ return function(){ var clickedAt = +new Date; setTimeout(function(){ !window.document.webkitHidden && setTimeout(function(){ if (+new Date - clickedAt < 2000){ window.location = 'https://itunes.apple.com/us/app/zhe-jiang-yi-dong-shou-ji/id898243566#weixin.qq.com'; } }, 500); }, 500) }; } document.getElementById("zjmobliestart").onclick = applink(); </script> </body> </html> <!Doctype html> <html xmlns=http://www.w3.org/1999/xhtml> <head> <meta http-equiv=Content-Type content="text/html;charset=utf-8"> <head> <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script> <title>直接喚醒demo</title> </head> <body> <style> #zjmobliestart{font-size:40px;} </style> <!-- 說明:通過h5可換醒app,如訪問一個URL就能直接打開應用,如果該應用APP沒有安裝,那么直接跳轉到App Store的APP下載頁面 兼容性一般:在手機各大瀏覽器(360瀏覽器 uc瀏覽器 搜狗瀏覽器 QQ瀏覽器 百度瀏覽器 )能喚醒。微信 QQ客戶端 新浪微博客戶端 騰訊微博客戶端無法喚醒。 --> <p id="zjmobliestart">喚醒浙江移動手機營業廳!</p> <script type="text/javascript"> function applink(){ window.location = 'zjmobile://platformapi/startapp'; var clickedAt = +new Date; setTimeout(function(){ !window.document.webkitHidden && setTimeout(function(){ if (+new Date - clickedAt < 2000){ window.location = 'https://itunes.apple.com/us/app/zhe-jiang-yi-dong-shou-ji/id898243566#weixin.qq.com'; } }, 500); }, 500) } applink(); </script> </body> </html>
