Open the link wake-up app in the UC browser, or skip to AppStore to download the app if it's not installed

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.