iOS Create desktop shortcuts

Source: Internet
Author: User
Tags home screen

Create desktop shortcuts on iOS
Application Scenarios:
Create a shortcut to a module or page within the app on the iOS device desktop, which allows you to access the appropriate module or page directly. Currently the app has the feature of the gold one-key navigation, 360 security guard small rocket.

Technical principle:
In iOS development, you can use OpenURL to open a Web page and create a shortcut to a webpage by sending it to the home screen via Safari, which is the way to create a desktop shortcut for an app. Start with a lightweight httpserver inside the app, open the local page with openurl:127.0.0.1, and use the HTML redirection to point the page to a URL that contains all the information that created the desktop shortcut, followed by the data Protocol, By using Safari's Send to home screen, you can reach our requirements.

Technical difficulties:
1. Create a local httpserver.
2. Create the encoding format for the local page and the Data protocol URL.

3. The local Httpserver service startup delay occurs when Safari is not started or when the app enters the background.

-(void) Createlinkwithdict: (nsdictionary *) dict Desktoplinktype: (sydesktoplinktype) linktype;    {NSString *title = [Dict objectforkey:desklinktitle];        NSString *urlscheme = [Dict objectforkey:desklinkurlscheme];    NSString *moduleid = [Dict Objectforkey:desklinkmoduletag];        NSString *imagename = [Dict objectforkey:desklinkiconname];    nsmutablestring *htmlstr = [[Nsmutablestring alloc] init];    [Htmlstr appendstring:@ "

iOS Create desktop shortcuts

Related Article

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.