Adding the Handler Method

To handle URL requests, you implement the URL-specific application delegate method shown in Recipe 11-8. Unfortunately, this method is guaranteed to trigger only when the application is already running. If the app is not running and the app is launched by the URL request, control first goes to the launching methods (will- and did-finish).

You want to ensure that your normal application:didFinishLaunchingWithOptions: method returns YES. This allows control to pass to application:openURL:sourceApplication:annotation:, so the incoming URL can be processed and handled.

Recipe 11-8 Providing URL Scheme Support

// Called if the app is open or if didFinishLaunchingWithOptions returns YES - (BOOL)application:(UIApplication ...

Get The Core iOS Developer’s Cookbook, Fifth 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.