Opening via URLs

The application and its delegate also have methods that relate to how our app interacts with the rest of the system. For example, if we receive a push notification from Apple’s push notification service—something we’d have to set up on a server, and which is beyond the scope of this book—we would get it in the app delegate callback application(didReceivePushNotification:fetchCompletionHandler:).

One way we can work directly with other applications on the device is found in a rather unusual place: URLs. UIApplication offers the method openURL:, which will launch other applications and have them deal with the NSURL. Most web page URLs, with schemes http or https, will open Safari. For example, we can background ourselves and ...

Get iOS 8 SDK Development, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.