Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

16. Documents and Data Sharing > Creating URL-Based Services

Creating URL-Based Services

Apple’s built-in applications offer a variety of services that can be accessed via URL calls. You can ask Safari to open Web pages, Maps to show a map, or use the mailto: style URL to start composing a letter in Mail. A URL scheme refers to the first part of the URL that appears before the colon, such as http: or ftp:.

These services work because iOS knows how to match URL schemes to applications. A URL that starts with http: opens in Mobile Safari. The mailto: URL always links to Mail. What you may not know is that you can define your own URL schemes and implement them in your applications. Not all standard schemes are supported on the iPhone. The FTP scheme is not available for use.

Custom schemes allow applications to launch whenever Mobile Safari (or another application) opens a URL of that type. For example, should your application register xyz, any xyz: links go directly to your application for handling, where they’re passed to the application delegate’s URL opening method (after first passing through the launch-with-options method; you’ll read more about these details later). You do not have to add any special coding there. If all you want to do is run an application, adding the scheme and opening the URL enables cross-application launching.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial