iOS Parse Facebook Login error 308 FBSDKLoginBadChallengeString

后端 未结 21 2443
小鲜肉
小鲜肉 2020-12-13 17:18

I\'m trying to implement Facebook login in my iOS app, using Parse.

let permissionsArray = [\"public_profile\", \"email\"]

PFFacebookUtils.logInInBackgroun         


        
相关标签:
21条回答
  • 2020-12-13 18:13

    Before downgrading, I would try to clear out the local cache. I've had this problem when switching between Facebook accounts. Delete your app, force the Facebook to quit and then re-run everything and see if it persists. There may be a bug where Facebook is passing an old cached key that is no longer valid. Downgrading could be clearing the cache or the older version doesn't have the bug.

    0 讨论(0)
  • Im using PFFacebookUtils 1.9.0 and FBSDKLoginKit 4.7.0 happend to me after logout and login(without restarting app) solution - objective c: just add [[PFFacebookUtils facebookLoginManager] logOut]; before [PFFacebookUtils logInInBackgroundWithReadPermissions

    0 讨论(0)
  • 2020-12-13 18:15

    Use the same FBSDKLoginManager instance until logout, THEN create a new instance.

    [fbLoginManager logOut];
    fbLoginManager = [[FBSDKLoginManager alloc] init];
    
    0 讨论(0)
  • 2020-12-13 18:17

    I'm using

    pod 'FBSDKCoreKit', '~> 4.8.0'
    pod 'FBSDKLoginKit', '~> 4.8.0'
    pod 'FBSDKShareKit', '~> 4.8.0'
    

    ... and had the code 308 problem when I logged out and logged in during the same session. Using [[FBSDKLoginManager alloc] logOut] or [facebookLoginManager logOut] (with a persisted manager) just before calling logInWithReadPermissions: didn't work, but adding

    [FBSDKAccessToken setCurrentAccessToken:nil];
    [FBSDKProfile setCurrentProfile:nil];
    

    before the logInWithReadPermissions: call works ok. (Tested in iOS 9.2.)

    0 讨论(0)
  • 2020-12-13 18:18

    Apparently the only solution that worked for me is to add the Keychain Sharing Entitlement for the target.

    You can find it in Project_name->target_name->Capabilities->Keychain Sharing

    0 讨论(0)
  • 2020-12-13 18:20

    I only saw this error when I logged out, then logged back in.

    My login and logout code were located in different files, as the relevant UI for login and logout are entirely different, and I had instantiated two separate FBSDKLoginManager instances. Consolidating to only one instance solved the problem for me.

    0 讨论(0)
提交回复
热议问题