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(didReceiveRemoteNotification: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 9 SDK Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.