Open the link wake-up app in the UC browser, or skip to AppStore to download the app if it's not installed
It needs to be set up in the project as follows:
1. Open the Myapp-info.plist file in the project
2. Open the file with a new URL types, as shown in:
Use the following code in the Web page you want to open:
<!--a tag link, set to the corresponding download link; Click the Open action, register-- <a href= "https://itunes.apple.com/cn/app/id892359007" in the Click event Id= "Openapp" > My apps </a> <script type= "Text/javascript" > document.getElementById (' Openapp ') . onclick = function (e) { //try to open the app via an IFRAME, switch directly to the app if it opens normally, and automatically block the default behavior of the A tag //Otherwise open the HREF link of the A tag var IFR = Document.createelement (' iframe '); IFR.SRC = ' laoshi://'; Ifr.style.display = ' None '; Document.body.appendChild (IFR); Window.settimeout (function () { document.body.removeChild (IFR); },3000) }; </script>
A link to my app appears when you open it with a UC browser
Finally, the following methods are implemented in Appdelegate:
-(BOOL) Application: (UIApplication *) application Handleopenurl: (nsurl *) URL { return YES;}
This allows you to launch your app on the iphone's UC browser by clicking on the My App link address.
Extended reading: http://www.wahenzan.com/a/mdev/ios/2014/1217/365.html
http://www.w3ctech.com/topic/287
Open the link wake-up app in the UC browser, or skip to AppStore to download the app if it's not installed