title: Facebook login is failing sometimes in iOS SDK 4.38.0
body: <p>Everything was working fine before. Now I changed few things:</p>
  <ol>
  <li>updated to Xcode 10.0 (10A255)</li>
  <li>updated to Facebook iOS SDK 4.38.0</li>
  </ol>
  <p>Now what is happening, sometimes login is getting failed. It is happening on both iOS 12 Device and Simulator. Before I didn't see this issue.</p>
  <p>My login code is below:</p>
  <pre><code>    if (![FBSDKAccessToken currentAccessToken])
          {            
              FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc] init];
              [loginManager logInWithReadPermissions:@[@&quot;email&quot;]
                                  fromViewController:self
                                             handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { 
  
             if (error) {
                 // show the error: **sometimes I get in this block**
             } else {
               if ([[FBSDKAccessToken currentAccessToken].permissions containsObject:@&quot;email&quot;])
                {
                  // get user basic information like name and picture
                }
  }
  </code></pre>
  <p>The same code works sometimes and sometimes not.</p>
  <p>You can try to reproduce this by uninstalling the app or by login/logout/login.</p>
  <p>Have anyone faced this issue with latest SDK 4.38 / Xcode 10?</p>
  <p>I am getting this error:</p>
  <p>Error Domain=com.facebook.sdk.login Code=308 &quot;(null)&quot;</p>
  <p>For other developers I also wanted to add 3 things which were not working in my case:</p>
  <ol>
  <li>enabling keychain from capabilities</li>
  <li>making FBSDKLoginManager instance as nil after logout</li>
  <li>creating the singleton for FBSDKLoginManager</li>
  </ol>
  <hr />
  <p>I am using Facebook 4.36, now I am seeing this warning <em>&quot;Your Facebook SDK is out of date. We recommend upgrading to the latest Version 4.37.0, to ensure your app's performance is not affected and to take advantage of our newest features!&quot;</em></p>
  <p>From the following url I downloaded 4.40.0, still I am getting same warning.</p>
  <p><a href="https://developers.facebook.com/docs/ios/downloads/" rel="nofollow noreferrer">https://developers.facebook.com/docs/ios/downloads/</a></p>
  <p>4.44.0 is broken.</p>
  <p>If I download 5.x.x from GitHub then I noticed .framework files are not there like FBSDKSharekit.frameworkd, Bolts.framework.</p>
  <p>If anyone switched from 4.x.x to 5.x.x please let me know (not using pod)</p>