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