Code Features:
Determine if your phone/tablet is installed with app
If the installation calls the app scheme, the incoming URL is used as a parameter for subsequent operations
If not installed, jump to app store/google play download app
Copy Code code as follows:
(function () {
var OpenURL = Window.location.search;
try{
OpenURL = openurl.substring (1,openurl.length);
}catch (e) {
}
var Isios = navigator.userAgent.match (' IPad ')
|| Navigator.userAgent.match (' IPhone ')
|| Navigator.userAgent.match (' IPod '), isandroid = Navigator.useragent
. Match (' Android '), Isdesktop =!isios&&!isandroid;
if (Isios) {
settimeout (function () {window.location = "itms-apps://itunes.apple.com/app/[name]/[id]?mt=8";},25);
window.location = "[scheme]://[host]?url=" +openurl;
}else if (isandroid) {
window.location = "intent://[host]/" + "url=" +openurl+ "#Intent; Scheme=[scheme];p ackage=[package_name];end";
}else{
Window.location.href = OpenURL;
}
})();