title: What is the correct way of connecting Firebase UI and Facebook SDK in AppDelegate?
body: <p>I want to use both Firebase UI (for signup/login) and Facebook SDK (for sharing/posting) in my React Native app.</p>
  
  <p>Both SDKs want to control the <code>application:(UIApplication *)app openURL:(NSURL *)url</code> handler.
  Here's <a href="https://developers.facebook.com/docs/ios/getting-started/#app-delegate" rel="nofollow noreferrer">Facebook openURL code</a> and <a href="https://github.com/firebase/FirebaseUI-iOS/blob/master/FirebaseAuthUI/README.md#configuration" rel="nofollow noreferrer">Firebase UI openURL</a>.</p>
  
  <p>What is the correct way to combine the two snippets? I've come up with the code below, but neither SDK explains what URLs do they handle and when, so I'm not sure which one should execute first?</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options {
  
    NSString *sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey];
    id annotation = options[UIApplicationOpenURLOptionsAnnotationKey];
  
    BOOL handled = [[FUIAuth defaultAuthUI] handleOpenURL:url sourceApplication:sourceApplication];
  
    if (!handled) {
      handled = [[FBSDKApplicationDelegate sharedInstance] application:app
        openURL:url
        sourceApplication:sourceApplication
        annotation:annotation
      ];
    }
    return handled;
  }
  </code></pre>