title: Facebook Login on iOS 8; App doesn't work after login switch
body: <p>I'm using the latest FBSDKLoginKit (4.10.1) to let my users authenticate with Facebook. It works perfectly on iOS 9, but not on iOS 8. When the user authenticates, the app switches to either the native facebook app or safari to log in. When logged in, the app switches back to my app, but then nothing happens. The handler block isn't executed. Exact the same code works on iOS 9, but not on 8. I noticed that when my app switches to safari to authenticate, the debugger of xcode detaches from the simulator; so I can't spot any errors. This doesn't happen on iOS 9.</p>
  
  <p>This is my code to login:</p>
  
  <pre><code>@IBAction func login(sender: AnyObject) {
  
      let facebookLogin = FBSDKLoginManager()
  
      facebookLogin.logInWithReadPermissions(["public_profile", "email", "user_friends"], fromViewController: self, handler: {
          (facebookResult, facebookError) -&gt; Void in
  
          // some logic which isn't executed
      })
  }
  </code></pre>
  
  <p>This is my info.plist:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
      &lt;key&gt;CFBundleDevelopmentRegion&lt;/key&gt;
      &lt;string&gt;en&lt;/string&gt;
      &lt;key&gt;CFBundleExecutable&lt;/key&gt;
      &lt;string&gt;$(EXECUTABLE_NAME)&lt;/string&gt;
      &lt;key&gt;CFBundleIdentifier&lt;/key&gt;
      &lt;string&gt;$(PRODUCT_BUNDLE_IDENTIFIER)&lt;/string&gt;
      &lt;key&gt;CFBundleInfoDictionaryVersion&lt;/key&gt;
      &lt;string&gt;6.0&lt;/string&gt;
      &lt;key&gt;CFBundleName&lt;/key&gt;
      &lt;string&gt;$(PRODUCT_NAME)&lt;/string&gt;
      &lt;key&gt;CFBundlePackageType&lt;/key&gt;
      &lt;string&gt;APPL&lt;/string&gt;
      &lt;key&gt;CFBundleShortVersionString&lt;/key&gt;
      &lt;string&gt;0.1&lt;/string&gt;
      &lt;key&gt;CFBundleSignature&lt;/key&gt;
      &lt;string&gt;????&lt;/string&gt;
      &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;fb190918247921312&lt;/string&gt;
              &lt;/array&gt;
          &lt;/dict&gt;
      &lt;/array&gt;
      &lt;key&gt;CFBundleVersion&lt;/key&gt;
      &lt;string&gt;5&lt;/string&gt;
      &lt;key&gt;FacebookAppID&lt;/key&gt;
      &lt;string&gt;190918247921312&lt;/string&gt;
      &lt;key&gt;FacebookDisplayName&lt;/key&gt;
      &lt;string&gt;RegelBaas&lt;/string&gt;
      &lt;key&gt;LSRequiresIPhoneOS&lt;/key&gt;
      &lt;true/&gt;
      &lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;NSExceptionDomains&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;akamaihd.net&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;NSIncludesSubdomains&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;NSThirdPartyExceptionRequiresForwardSecrecy&lt;/key&gt;
                  &lt;false/&gt;
              &lt;/dict&gt;
              &lt;key&gt;facebook.com&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;NSIncludesSubdomains&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;NSThirdPartyExceptionRequiresForwardSecrecy&lt;/key&gt;
                  &lt;false/&gt;
              &lt;/dict&gt;
              &lt;key&gt;fbcdn.net&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;NSIncludesSubdomains&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;NSThirdPartyExceptionRequiresForwardSecrecy&lt;/key&gt;
                  &lt;false/&gt;
              &lt;/dict&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
      &lt;key&gt;UIAppFonts&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;Stackyard_PERSONAL_USE.ttf&lt;/string&gt;
      &lt;/array&gt;
      &lt;key&gt;UIApplicationExitsOnSuspend&lt;/key&gt;
      &lt;true/&gt;
      &lt;key&gt;UILaunchStoryboardName&lt;/key&gt;
      &lt;string&gt;LaunchScreen&lt;/string&gt;
      &lt;key&gt;UIMainStoryboardFile&lt;/key&gt;
      &lt;string&gt;Main&lt;/string&gt;
      &lt;key&gt;UIRequiredDeviceCapabilities&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;armv7&lt;/string&gt;
      &lt;/array&gt;
      &lt;key&gt;UISupportedInterfaceOrientations&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;UIInterfaceOrientationPortrait&lt;/string&gt;
      &lt;/array&gt;
      &lt;key&gt;LSApplicationQueriesSchemes&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;fbapi&lt;/string&gt;
          &lt;string&gt;fbapi20130214&lt;/string&gt;
          &lt;string&gt;fbapi20130410&lt;/string&gt;
          &lt;string&gt;fbapi20130702&lt;/string&gt;
          &lt;string&gt;fbapi20131010&lt;/string&gt;
          &lt;string&gt;fbapi20131219&lt;/string&gt;
          &lt;string&gt;fbapi20140410&lt;/string&gt;
          &lt;string&gt;fbapi20140116&lt;/string&gt;
          &lt;string&gt;fbapi20150313&lt;/string&gt;
          &lt;string&gt;fbapi20150629&lt;/string&gt;
          &lt;string&gt;fbauth&lt;/string&gt;
          &lt;string&gt;fbauth2&lt;/string&gt;
          &lt;string&gt;fb-messenger-api20140430&lt;/string&gt;
      &lt;/array&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>And this is my appdelegate:</p>
  
  <pre><code>//
  //  AppDelegate.swift
  //  RegelBaas
  //
  //  Created by J. Weijland on 12-12-15.
  //  Copyright © 2015 J. Weijland. All rights reserved.
  //
  
  import UIKit
  import FBSDKCoreKit
  import FBSDKLoginKit
  import Batch
  
  @UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate {
  
      var window: UIWindow?
  
      func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool {
          // Styling
  
          UINavigationBar.appearance().barTintColor = UIColor(red: 1.0, green: (102/255), blue: (102/255), alpha: 1)
  
          UINavigationBar.appearance().tintColor = UIColor.whiteColor()
  
          FBSDKApplicationDelegate.sharedInstance()
              .application(application, didFinishLaunchingWithOptions: launchOptions)
  
          return true
      }
  
      func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -&gt; Bool
      {
          return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
      }
  
      func applicationDidBecomeActive(application: UIApplication) {
          // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
          FBSDKAppEvents.activateApp()
      }
  
      func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject])
      {
  
      }
  }
  </code></pre>
  
  <p>I guess something is wrong with my appdelegate, because I think my app doesn't recognize the back-switch from safari/FB native to my app. The strange thing is that everything works just fine in iOS 9!</p>
  
  <ul>
  <li>With 'working on iOS 9' I mean it works running on a device on iOS 9. I'm compiling with iOS SDK 9.2.</li>
  </ul>