title: How to handle UIApplication handleOpenURL with multiple URL's
body: <p>I have an app that will be using both Facebook and Instagram API's, both of which require me to use this delegate method:</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  
      return [PFFacebookUtils handleOpenURL:url];
  
  }
  </code></pre>
  
  <p>and this is the code provided by instagram:</p>
  
  <pre><code>-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  
      return [self.instagram handleOpenURL:url];
  
  }
  </code></pre>
  
  <p>As you can see, this is a problem because I can only return one URL handler, but I need to be able to decide which one. </p>
  
  <p>In my app delegate, I have commented out the Instagram option above and left only Facebook. As expected, Facebook will work just fine, but I get this error when I tap authorize on Instagram:</p>
  
  <p><img src="https://i.stack.imgur.com/qxxYg.png" alt="Instagram URL error"></p>
  
  <p>Obviously, Facebook is trying to handle the return URL from Instagram so it will error.</p>
  
  <p>Is it plausible to check the URL to see if it contains the app ID for each service I am trying? So if URL contains the instagram ID, then return the instagram handler, if it contains the Facebook ID, then return the Facebook Handler.</p>
  
  <p>Any help would be great, thanks!</p>