Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The parameter 'custom_events' or 'custom_events_file' is required for the 'CUSTOM_APP_EVENTS' activity

Upon upgrading from the Facebook iOS SDK version 3.7.1 to 3.8, I started seeing the following in my console log when authenticating with my app through Facebook:

FBSDKLog: Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0xc5a9cf0 {com.facebook.sdk:HTTPStatusCode=400, com.facebook.sdk:ParsedJSONResponseKey={
    body =     {
        error =         {
            code = 100;
            message = "(#100) The parameter 'custom_events' or 'custom_events_file' is required for the 'CUSTOM_APP_EVENTS' activity";
            type = OAuthException;
        };
    };
    code = 400;
    headers =     (
                {
            name = "Access-Control-Allow-Origin";
            value = "*";
        },
                {
            name = "Cache-Control";
            value = "no-store";
        },
                {
            name = Connection;
            value = close;
        },
                {
            name = "Content-Type";
            value = "text/javascript; charset=UTF-8";
        },
                {
            name = Expires;
            value = "Sat, 01 Jan 2000 00:00:00 GMT";
        },
                {
            name = Pragma;
            value = "no-cache";
        },
                {
            name = "WWW-Authenticate";
            value = "OAuth \"Facebook Platform\" \"invalid_request\" \"(#100) The parameter 'custom_events' or 'custom_events_file' is required for the 'CUSTOM_APP_EVENTS' activity\"";
        },
                {
            name = "x-fb-loadmon";
            value = "0,2.76,90";
        }
    );
}, com.facebook.sdk:ErrorSessionKey=<FBSession: 0x12e5e9c0, state: FBSessionStateOpen, loginHandler: 0x12e58630, appID:..., urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0xd884b00>, expirationDate:..., refreshDate:..., attemptedRefreshDate:..., permissions:...>}

I've downloaded the most recent versions of the sample Facebook iOS apps and verified that my calls to the Facebook SDK in my AppDelegate are up-to-date. To authenticate, I am sending the openActiveSessionWithReadPermissions:allowLoginUI:completionHandler: message to FBSession.

It seems like this very well could be a Facebook bug (I am going to file a bug with them), but it's also possible that I'm doing something wrong – any help/insights would be appreciated!

I've temporarily resolved the issue by adding a call to [FBAppEvents setFlushBehavior:FBAppEventsFlushBehaviorExplicitOnly]; in my AppDelegate, but I would prefer a more comprehensive solution.

3/24/2014 Edit

This no longer repros on 3.8 (nor does it repro on 3.13, which I also tested). Seems like Facebook must have fixed this on the server.

like image 879
mon4goos Avatar asked Oct 01 '13 21:10

mon4goos


2 Answers

  1. Go to developers.facebook.com
  2. From the header bar, click on "Apps"
  3. Select the app you're currently working on and click "Edit App"
  4. On the left hand navigation bar, you'll see a "Settings" tab
  5. Under "Settings" click on the "Advanced" tab and scroll down to the "Insights" section
  6. Change "Install Insights" and "Mobile SDK Insights" to "Disabled"
like image 198
neverbendeasy Avatar answered Nov 13 '22 21:11

neverbendeasy


I am running FB SDK 3.9, and still getting this error.

I found this as a workaround.

Add this line in the AppDelegate::appDidFinishLaunchingWithOptions

[FBAppEvents setFlushBehavior:FBAppEventsFlushBehaviorExplicitOnly];
like image 27
Rayfleck Avatar answered Nov 13 '22 23:11

Rayfleck