26

This is more informative than anything. I couldn't for the life of me find anything on error code 8 when trying to access the login prompt (aka safari) when debugging my ios app. After I hit the log into facebook button in my app it would attempt to open safari then dump me back to the login page to my app. The error was being caused by the permissions array. I had the the permission "public_profile" spelled "public profile" which was throwing an error obviously. So make sure your permission are type corrected if you get the com.facebook.sdk.core error 8.

Hope that helps someone.

blackops
  • 2,205
  • 2
  • 18
  • 22

15 Answers15

9

Make sure your permissions are typed correctly

   func loginButton(loginButton: FBSDKLoginButton!, didCompleteWithResult result: FBSDKLoginManagerLoginResult!, error: NSError!) {

            if error == nil {
                println("login complete")
                self.performSegueWithIdentifier("showLogin", sender: self)

            }else{

                println(error.localizedDescription)
    //com.facebook.sdk.core error 8.
            }
        }
blackops
  • 2,205
  • 2
  • 18
  • 22
4

In my case this error was caused by improper bundle id set in facebook settings of the app itself. Facebook "bundle id" is case sensitive, in my Info.plist I had uppercase product name, but in fb settings - lowercase.

Wladek Surala
  • 2,590
  • 1
  • 26
  • 31
4

In my case, I was using a Facebook account that hadn't yet been added to any of the Facebook app's admins/developers/testers roles.

michael
  • 41
  • 2
3

In my case, after spending several hours of debugging I found that I was using the API,

func application(application: UIApplication,
                 openURL url: NSURL, options: [String: AnyObject]) -> Bool {
    if #available(iOS 9.0, *) {
        FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: options)
    } else {
        // Fallback on earlier versions
    }
    return true
}

which is deprecated for iOS 9.So, I used:

func application(application: UIApplication,
                 openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
    FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
    return true
}

Which worked for me. Hope this saves time of someone.

Sanchit Kumar Singh
  • 513
  • 1
  • 5
  • 17
3

MAN!!! In my case it was the "bio" in the parameter that was causing this error. Facebook has changed the "bio" key to "about". So anyone using "bio" in parameters should change it to "about"

Pheww!!!

Hyder
  • 1,163
  • 2
  • 13
  • 37
2

In my case It was wrong version. Instead of version: "v2.7", I used version: "2.7"

Naveen Ramanathan
  • 2,166
  • 1
  • 19
  • 21
1

In my case it was because I listed name twice in the fields array. Assume that would apply to any field requested twice.

Damien
  • 1,647
  • 2
  • 16
  • 17
0

I had the same problem. It was because I didn't implement facebook login feature. After adding that, I logged in and my problem got solved.

Suhaib
  • 2,031
  • 3
  • 24
  • 36
0

In my case, I was playing with the Facebook Ads API and I tried to get a field but the name was wrong.

I had insights{date_start,date_end}, instead of insights{date_start, date_stop}.

More info here.

Hope it helps anyone.

Paul Razvan Berg
  • 16,949
  • 9
  • 76
  • 114
0

In my case, I tried to get Facebook Id without logging into Facebook. Make sure you're logged into Facebook.

let accessToken = FBSDKAccessToken.current()
    if accessToken != nil {

        self.getCurrentUserFbId()
        print("LoggedIn")

    } else {

        print("Not loggedIn")
        self.loginIntoFacebook()
    }

Hope this will helpful for anyone.

Vinoth Vino
  • 9,166
  • 3
  • 66
  • 70
0

When it happened to me, I found that Facebook's access token was expired. Someone decided to store access token in UserDefaults and reuse it later. Of course all tokens more than ~2 months old were expired.

Vitalii
  • 4,267
  • 1
  • 40
  • 45
0

In my case it was because of GraphRequest.

The error response is

"com.facebook.sdk:FBSDKErrorDeveloperMessageKey" = "Syntax error \"Expected end of string instead of \"%\".\" at character 5: email%2Cname%2Cgender%2Cpicture"; "com.facebook.sdk:FBSDKGraphRequestErrorCategoryKey" = 0; "com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCode" = 2500; "com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey" = 400; "com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey" = { body = { error = { code = 2500; "fbtrace_id" = AFEUYbcYP39; message = "Syntax error \"Expected end of string instead of \"%\".\" at character 5: email%2Cname%2Cgender%2Cpicture"; type = OAuthException; }; }; code = 400; };

The issue about that is https://github.com/facebook/facebook-swift-sdk/issues/309

Nike Kov
  • 12,630
  • 8
  • 75
  • 122
0

In my case was because of birthday,friendlists . removing them started to work.

LittleBoat
  • 341
  • 3
  • 4
0

For me just had to go facebook developer under platform and activate deep linking

Omair
  • 7
  • 5
-1

In our case we were seeing this issue while trying to log in with some test account (but not all). We were not following Facebook's recommended practice:

Before you test each use case below, make sure you remove your app from your test user's Facebook account using app settings.

After we did it for the failing test accounts, we were able to log in.

FreeNickname
  • 7,398
  • 2
  • 30
  • 60