IOS
scheme
This solution is basically aimed at other browsers other than WeChat, QQ built-in browsers, QQ browsers, etc. You can ask for a scheme from native, and then put it in the a tag or jump it.
A page jump is done with an iframe. If there is any, it will trigger the timer to jump to the download address if there is no scheme. However, in iOS, you will encounter two prompts when there is no app.
var openApp = function (src) { // Try to open the APP through an iframe. If it can be opened normally, it will directly switch to the APP and automatically block the default behavior of the a tag. // Otherwise, open the href link of the a tag const ifr = ('iframe'); = src; = 'none'; (ifr); var poenTime = +new Date() (() => { (ifr); if ((+new Date()-openTime>2500)){ = 'APP Store download address ' } }, 600); };
Link(ios)
This is a feature launched by iOS9. If your app supports Universal Links, you can easily start the app through traditional HTTP links (if your app is already installed on the iOS device, you don’t need to make any extra judgments, etc.), or open a web page (your app is not installed on the iOS device). Perhaps it can be explained more simply that before iOS9, we usually only had schemes for the need to wake up apps from various browsers, Safari, UIWebView or WKWebView.
="Universal Link given by APP"
Summarize
Compatible writing method
if (isGreaterThan9){ ="Universal Link given by APP" ; return; } openApp(src)
android
Similar
if (openApp('url scheme url')) { openApp('url scheme url'); } else { setTimeout(() => { = 'APP Market Download Address';// It's usually Google, and each app store is different }, 600); } }
Summarize
This is the article about the mobile H5 Arousal APP. For more related contents of the mobile H5 Arousal APP, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!