title: iOS Parse Facebook Login error 308 FBSDKLoginBadChallengeString
body: <p>I'm trying to implement Facebook login in my iOS app, using Parse. </p>
  
  <pre><code>let permissionsArray = ["public_profile", "email"]
  
  PFFacebookUtils.logInInBackgroundWithReadPermissions(permissionsArray)
      { (user: PFUser?, error: NSError?) in
  
      if let user = user {
          //we logged in!
      }
      else {
          //login error!
      }
  }
  </code></pre>
  
  <p>This works well in the Simulator, but not on the device. On the device, I get this error:</p>
  
  <blockquote>
    <p>Error Domain=com.facebook.sdk.login Code=308 "The operation couldn’t be completed. (com.facebook.sdk.login error 308.)</p>
  </blockquote>
  
  <p>Error code 308 is for <a href="https://github.com/facebook/facebook-ios-sdk/blob/master/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginConstants.h#L74"><code>FBSDKLoginBadChallengeString</code></a>, "The login response was missing a valid challenge string."</p>
  
  <p>After I authorise my app on Facebook, this gets called:</p>
  
  <pre><code>func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -&gt; Bool {
      return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
  }
  </code></pre>
  
  <p>The url is: </p>
  
  <p><code>fb1640722449492705://authorize/#state=%7B%22challenge%22%3A%225OKWv3wN%2BEH%2BeQu48Xv6ty%2BRuek%3D%22%2C%22com.facebook.sdk_client_state%22%3Atrue%2C%223_method%22%3A1%2C%220_auth_logger_id%22%3A%22564CD915-2CFC-4989-9AF6-CEA389908D51%22%7D&amp;granted_scopes=user_birthday%2Cpublic_profile&amp;denied_scopes=&amp;signed_request=c8SBBDeaNpF-R_XTYx4LRA0BWm5p9IwXDr8M4nL3YXI.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNvZGUiOiJBUURhTXJibGw4Q3dITkd5M0xnQmNkVTNuYWRkeEVoTU5mMmx3eFpZU2IwZl9SU284YXhZdXZaRS02RnA2bU5Cdy1CWkVoRmt2Zk1xX1AxSHltUG00aWhkWE9hYmlvWFBiMnpCYkVnR1RRX3lzZVFIZXdHU19OcmpkNUF6WGtob1dfVE4wTmRrSGk5MzY0V2hFWUJDV0dfcE16RXpQVExHWE13X1dzb0QzZGtITm5fM0tHNjFxUjJyM3RDWVlNQTE4WENpS1dXTHUyM2dIRVhmTXc3ZTQ0M2xDQUtGRl9KSXcyVk1sS01FOTQ4dHQ2U1Fqb0tlVkp4RmJNSEFsWDZFYWxlUnQ2aGRrTGZlU2xuVTV5VjZ1bFhldHkxeEV5RmRDZVFHb2RXQ0dULVVCd3QyM0haY0dxNk8zbnE1cDRNWjNFZ012U2JhSGZyMmF6Wm8xUXk2X2xSQVNWcFlMVDZUdU5wZnMwVkJqNEdSaFEiLCJpc3N1ZWRfYXQiOjE0MzM0MTg2MDksInVzZXJfaWQiOiIxNDM3MzM0ODk5OTIwNDA5In0&amp;access_token=CAAXUOnbG6uEBANtAd9DzWBSu4LLOEcPsu86Ny0Ir
  </code></p>
  
  <p>Yes, I followed everything in <a href="https://github.com/ParsePlatform/ParseUI-iOS/wiki/Integrate-Login-with-Facebook">Parse's Facebook login guide</a> (made sure that all bundle IDs match, implemented all required AppDelegate methods, etc). </p>
  
  <p>What exactly does this error mean and how do you solve it?</p>