Facebook iOS SDK 3.1: "Error: HTTP status code: 400"

stipe108 picture stipe108 · Sep 26, 2012 · Viewed 10.8k times · Source

I am running the Facebook SDK 3.1 on Xcode 4.5GM with iOS6 simulator. I connect to FB in the iOS settings and successfully FB connect in my app using the new iOS6 FBConnect UI. I have an access token, can see my friends, send app requests, post to my wall, etc. However, every time I initiate any sort of FBURLConnection is made, I see this printed to my console:

Error: HTTP status code: 400

I went into the FB code and printed the reponse when this error is printed and I get:

{
    body =     {
        error =         {
            code = 100;
            message = "(#100) The parameter 'attribution' is required for the 'mobile_app_install' activity";
            type = OAuthException;
        };
    };
    code = 400;
}

Does anyone know how to resolve this? All functionality seems to work, but I keep seeing this spam my console.

Answer

Anthony Dmitriyev picture Anthony Dmitriyev · Nov 9, 2012

Right after the session is created do this:

[FBSession setActiveSession:session];