title: Facebook Login Issue with WebView not Closing using (Swift 3.0 FacebookLogin 0.2.0)
body: <p>The pods I'm using from my podfile:<br>
  PODS:<br>
    - Bolts (1.8.4):<br>
      - Bolts/AppLinks (= 1.8.4)<br>
      - Bolts/Tasks (= 1.8.4)<br>
    - Bolts/AppLinks (1.8.4):<br>
      - Bolts/Tasks<br>
    - Bolts/Tasks (1.8.4)<br>
    - FacebookCore (0.2.0):<br>
      - Bolts (~> 1.8)<br>
      - FBSDKCoreKit (~> 4.15)<br>
    - FacebookLogin (0.2.0):<br>
      - Bolts (~> 1.8)<br>
      - FacebookCore (~> 0.2)<br>
      - FBSDKCoreKit (~> 4.15)<br>
      - FBSDKLoginKit (~> 4.15)<br>
    - FBSDKCoreKit (4.16.0):<br>
      - Bolts (~> 1.7)<br>
    - FBSDKLoginKit (4.16.1):<br>
      - FBSDKCoreKit  </p>
  
  <p>My LoginViewController.swift code:</p>
  
  <pre><code>import FacebookLogin
  class LoginViewController: UIViewController, LoginButtonDelegate {
  /*!
   @abstract Sent to the delegate when the button was used to login.
   @param loginButton the sender
   @param result The results of the login
   @param error The error (if any) from the login
   */
  
  
  override func viewDidLoad() {
      super.viewDidLoad()
      let loginButton = LoginButton(readPermissions: [ .publicProfile ])
      loginButton.center = view.center
      loginButton.delegate = self;
      view.addSubview(loginButton)
  
  }
  
  /**
   Called when the button was used to login and the process finished.
  
   - parameter loginButton: Button that was used to login.
   - parameter result:      The result of the login.
   */
  public func loginButtonDidCompleteLogin(_ loginButton: FacebookLogin.LoginButton, result: FacebookLogin.LoginResult){
      print("hello!")
  }
  
  /**
   Called when the button was used to logout.
  
   - parameter loginButton: Button that was used to logout.
   */
  public func loginButtonDidLogOut(_ loginButton: FacebookLogin.LoginButton){
      print("goodbye")
  }
  </code></pre>
  
  <p>My modified AppDelegate.swift Code:</p>
  
  <pre><code>public func application(_ application: UIApplication,  didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -&gt; Bool {
      // Override point for customization after application launch.
      return SDKApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
  
  func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -&gt; Bool {
      return SDKApplicationDelegate.shared.application(application, open: url, options: [:])
  }
  </code></pre>
  
  <p><strong>Context:</strong><br>
  I downloaded everything with pods, and was prompted by xcode to convert all code to swift 3.0 so I did so. I followed this guide for getting started and logging in: <a href="https://developers.facebook.com/docs/swift" rel="nofollow">https://developers.facebook.com/docs/swift</a>
  If I run without the second function in my app delegate, I am forced to press "done" from the web view that pops up after logging in, then I get a response "hello" and if I set a breakpoint at that point I see that my login was perceived as canceled. In addition, the facebook button I initialized still prompts me to log in so it definitely did not work. In addition I also get this error: </p>
  
  <blockquote>
    <p>-canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"</p>
  </blockquote>
  
  <p>HOWEVER, if I leave that method in, it closes but the delegate never gets called. Also the button proceeds to prompt me to log in. </p>
  
  <p>My Info.plist:  </p>
  
  <pre><code>&lt;key&gt;CFBundleURLTypes&lt;/key&gt;
      &lt;array&gt;
          &lt;dict&gt;
              &lt;key&gt;CFBundleURLSchemes&lt;/key&gt;
              &lt;array&gt;
                  &lt;string&gt;fbMYID&lt;/string&gt;
              &lt;/array&gt;
          &lt;/dict&gt;
      &lt;/array&gt;
      &lt;key&gt;FacebookAppID&lt;/key&gt;
      &lt;string&gt;MYID&lt;/string&gt;
      &lt;key&gt;FacebookDisplayName&lt;/key&gt;
      &lt;string&gt;MYAPPNAME&lt;/string&gt;
      &lt;key&gt;LSApplicationQueriesSchemes&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;fbapi&lt;/string&gt;
          &lt;string&gt;fb-messenger-api&lt;/string&gt;
          &lt;string&gt;fbauth2&lt;/string&gt;
          &lt;string&gt;fbshareextension&lt;/string&gt;
      &lt;/array&gt;
  </code></pre>
  
  <p><strong>Extra Information:</strong><br>
  I'm new to swift but I can tell that I need the method I took out to allow it to work but am unsure of how to approach this. I don't have anything called FBSDKApplicationDelegate (viewed from other questions similar that I've browsed) since I'm using the new swift SDK from here: <a href="https://developers.facebook.com/docs/swift" rel="nofollow">https://developers.facebook.com/docs/swift</a>. I'm guessing that doc for login is outdated given the current version of swift or I missed a link pointing to some pre-requisite. Please let me know if you have any idea of the solution to my issue. My info.plist should be all set or else I would have errors attempting to log in. I am able to reach the screen where it says You have already granted <em>MYAPP</em> permission. Then I proceed to press ok, then if I had the openURL method in my app delegate it closes, or it stays blank. I STRONGLY SUSPECT it has to do with the options that I left with a blank dict from the open method when calling the SDKApplicationDelegate.  Thanks</p>