FBSDK Login Error Code: 308 in Objective-C

前端 未结 18 3365
孤街浪徒
孤街浪徒 2021-01-30 20:13

I keep getting

\"Error Domain=com.facebook.sdk.login Code=308 \"The operation couldn’t be completed. (com.facebook.sdk.login error 308.)\"\"

相关标签:
18条回答
  • 2021-01-30 20:50

    I was getting the same error on xcode 7.1 ios 9.1 FB SDK 4.7.1. .

    Uninstalling, installing and testing without xcode works fine for the first time. This will allow you to plug back in the device and run it at least a couple of times (it seems to be a bit inconsistent...)

    0 讨论(0)
  • 2021-01-30 20:51

    I had the same problem and fixed it refreshing the system credentials

    [FBSDKLoginManager renewSystemCredentials:^(ACAccountCredentialRenewResult result, NSError *error) {
    
        [[[YourAuthManager manager] facebookLoginManager] logInWithReadPermissions:@[@"email"] fromViewController:nil handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
    
            if (error) {
                // Handle error
            } else if (result.isCancelled) {
                // Handle cancellations
            } else {
                // If you ask for multiple permissions at once, you
                // should check if specific permissions missing
                if ([result.grantedPermissions containsObject:@"email"]) {
                    // Do work
                }
            }
        }];
    }];
    

    This solution is less radical than reinstalling and you assure your users won't have to do it. My guess is that FBSDK 4.6 has some conflicts with iOS 9 system FB authentication credentials.

    Edited: After some time testing it kept happening, not as often as before but it was still an issue, so we downgraded to a previous version of FB SDK. Hopefully someone finds a better solution.

    0 讨论(0)
  • 2021-01-30 20:51

    In the FBSDKDelegate Method loginButtonWillLogin put this

    - (BOOL) loginButtonWillLogin:(FBSDKLoginButton *)loginButton{
    [FBSDKAccessToken setCurrentAccessToken:nil];
    return YES;}
    
    0 讨论(0)
  • 2021-01-30 20:53

    I'm getting the exact same thing FB SDK 4.6.0 Xcode 7.0 iOS9. All the setup & instructions on the facebook developer site were followed to the letter. None of the above solutions worked for me. I'm finding that the behaviour is worse when you're deploying to the device live and feeding back to the Xcode console while doing the login procedure. It's really pot luck if it actually logs you in or not. It seems to behave in a more predictable way when you just re-launch your app cold after deployment. -Yes this is in fact the case!

    When it decides to fail to login it results in the following error:

    Error Domain=com.facebook.sdk.login Code=308 "(null)"
    
    0 讨论(0)
  • 2021-01-30 20:53

    My solution on Xcode7.1, Swift2.0

    Step 1. Clean your build folder: option + command + K

    or: Choose Product > Clean

    Step 2. Clean your derived data: Choose Window > Projects:

    and then choose Delete:

    0 讨论(0)
  • 2021-01-30 20:53

    Same problem FB SDK 4.5.1 and none of the above solutions worked for me. I solved this by adding Bolts framework to project by drag & drop (from FacebookSDK directory)
    and then adding bolts framework to appDelegate

        #import <bolts/bolts.h>
    
    0 讨论(0)
提交回复
热议问题