title: Facebook Login doesn't doesn't dismiss Login Dialog after login
body: <p>Using <code>LoginManager</code> from the Facebook iOS SDK to login like so:</p>
  
  <pre><code>let loginManager = LoginManager()
  loginManager.logIn([.publicProfile, .email], viewController: self) { (loginResult) in
  </code></pre>
  
  <p>The Login Dialog opens facebook.com through Safari, which has a button for me to </p>
  
  <blockquote>
    <p>Log In with the Facebook App</p>
  </blockquote>
  
  <p>When I click "Continue" in the Facebook app I am returned back to my app, however the Login Dialog is not dismissed even though <code>loginResult</code> returns <code>.success</code>.   </p>
  
  <p>This is what is displayed after returning to my app after being successfully logged in:
  <a href="https://i.stack.imgur.com/gNETC.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/gNETC.jpg" alt="enter image description here"></a></p>
  
  <p>The only option is for me to click 'Cancel'. It seems like the Login Dialog is <code>SFAuthenticationViewController</code>, which currently contains 0 results on a Google search.</p>
  
  <p>It seems problems other people have had in the past was that in their <code>AppDelegate</code> they were not calling the appropriate authorization flow processing in <code>application:openURL:options:</code> but that is successfully being called like so:</p>
  
  <pre><code>@available(iOS 9.0, *)
  func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -&gt; Bool {
      print("application open url\n\(url)\noptions \(options)")
  
      if url.absoluteString.hasPrefix("fb") {
         print("Finishing Facebook log in flow")
         return SDKApplicationDelegate.shared.application(application, open: url, options: options)
      } else {
          print("Finishing Google sign in flow")
          return GIDSignIn.sharedInstance().handle(url, sourceApplication:options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: [:])
      }
  }
  </code></pre>
  
  <p>The only thing I can think of is some incompatibility issues since I am using Swift 4 on iOS 11 Developer beta, and the fact that there are no results online for <code>SFAuthenticationViewController</code> which is seemingly being used. </p>
  
  <p>I am unsure why the dialog isn't automatically being dismissed. </p>
  
  <hr>
  
  <p><strong>Update:</strong> </p>
  
  <p>I created a brand new, blank app with only a single button and the <code>FacebookCore</code> and <code>FacebookLogin</code> dependencies and the issue still persists. </p>
  
  <p>Steps followed:</p>
  
  <ol>
  <li><a href="https://developers.facebook.com/docs/facebook-login/ios" rel="noreferrer">https://developers.facebook.com/docs/facebook-login/ios</a></li>
  <li><a href="https://developers.facebook.com/docs/swift/getting-started" rel="noreferrer">https://developers.facebook.com/docs/swift/getting-started</a></li>
  <li><a href="https://developers.facebook.com/docs/swift/login" rel="noreferrer">https://developers.facebook.com/docs/swift/login</a></li>
  </ol>